Kouhei Sutou
null+****@clear*****
Thu Nov 21 13:05:54 JST 2013
Kouhei Sutou 2013-11-21 13:05:54 +0900 (Thu, 21 Nov 2013) New Revision: 2ee29dff135c5837b01e19bef32bb1f7797d9c6b https://github.com/droonga/drntest/commit/2ee29dff135c5837b01e19bef32bb1f7797d9c6b Message: Extract execution code as a method Modified files: lib/drntest/test-runner.rb Modified: lib/drntest/test-runner.rb (+8 -3) =================================================================== --- lib/drntest/test-runner.rb 2013-11-21 13:04:56 +0900 (b78293f) +++ lib/drntest/test-runner.rb 2013-11-21 13:05:54 +0900 (8a1c4b3) @@ -30,12 +30,10 @@ module Drntest end def run - client = Droonga::Client.new(tag: tester.tag, port: tester.port) result = TestResult.new(target_path.to_s) print "#{target_path}: " - request_envelope = load_request_envelope - actual = client.connection.send(request_envelope, :response => :one) + actual = execute_commands if actual actual = normalize_result(actual) result.actual = actual @@ -63,6 +61,13 @@ module Drntest result end + private + def execute_commands + client = Droonga::Client.new(tag: tester.tag, port: tester.port) + request_envelope = load_request_envelope + actual = client.connection.send(request_envelope, :response => :one) + end + def load_request_envelope JSON.parse(target_path.read) end -------------- next part -------------- HTML����������������������������...Download