[Groonga-commit] droonga/drntest at 91b11d1 [master] Save actual only when expected does not exist

Back to archive index

Yoji Shidara null+****@clear*****
Wed Sep 18 16:12:37 JST 2013


Yoji Shidara	2013-09-18 16:12:37 +0900 (Wed, 18 Sep 2013)

  New Revision: 91b11d1c19cadd1567830fd1d8357d590d3e20d8
  https://github.com/droonga/drntest/commit/91b11d1c19cadd1567830fd1d8357d590d3e20d8

  Message:
    Save actual only when expected does not exist

  Modified files:
    lib/drntest/tester.rb

  Modified: lib/drntest/tester.rb (+4 -4)
===================================================================
--- lib/drntest/tester.rb    2013-09-18 16:08:54 +0900 (a560149)
+++ lib/drntest/tester.rb    2013-09-18 16:12:37 +0900 (d16116c)
@@ -60,7 +60,6 @@ module Drntest
       client = Droonga::Client.new(tag: tag, port: port)
       envelope = JSON.parse(File.read(target))
       target_path = Pathname(target)
-      actual_path   = target_path.sub_ext(".actual")
       expected_path = target_path.sub_ext(".expected")
 
       print "#{target}: "
@@ -70,8 +69,6 @@ module Drntest
         return
       end
       actual = normalize_result(actual)
-      actual_json = actual.to_json
-      File.write(actual_path, actual_json)
 
       if File.exist?(expected_path)
         expected = JSON.parse(File.read(expected_path))
@@ -86,7 +83,10 @@ module Drntest
           p actual
         end
       else
-        puts "No expectation specified"
+        actual_path = target_path.sub_ext(".actual")
+        puts "No expectation specified. Saving result as #{actual_path}."
+        actual_json = actual.to_json
+        File.write(actual_path, actual_json)
       end
     end
 
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index