[Groonga-commit] droonga/drntest at ad9022f [master] Ensure adding new line at the last to formatted results

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Tue Dec 10 19:12:34 JST 2013


Kouhei Sutou	2013-12-10 19:12:34 +0900 (Tue, 10 Dec 2013)

  New Revision: ad9022fdce3ec47bebf09c50ad043c27dd0a6a10
  https://github.com/droonga/drntest/commit/ad9022fdce3ec47bebf09c50ad043c27dd0a6a10

  Message:
    Ensure adding new line at the last to formatted results
    
    It suppress a "No newline at end of file" warning from diff.

  Modified files:
    lib/drntest/test-runner.rb

  Modified: lib/drntest/test-runner.rb (+15 -8)
===================================================================
--- lib/drntest/test-runner.rb    2013-12-10 19:09:36 +0900 (20a474e)
+++ lib/drntest/test-runner.rb    2013-12-10 19:12:34 +0900 (8a8cbb9)
@@ -227,14 +227,21 @@ module Drntest
     end
 
     def format_results(results)
-      results.collect do |result|
-        begin
-          JSON.pretty_generate(result)
-        rescue JSON::GeneratorError => error
-          p error
-          p result
-        end
-      end.join("\n")
+      formatted_results = ""
+      results.each do |result|
+        formatted_results << format_result(result)
+        formatted_results << "\n"
+      end
+      formatted_results
+    end
+
+    def format_result(result)
+      begin
+        JSON.pretty_generate(result)
+      rescue JSON::GeneratorError => error
+        p error
+        p result
+      end
     end
 
     def create_temporary_file(key, content)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index