Haruka Yoshihara
null+****@clear*****
Thu Dec 13 19:15:44 JST 2012
Haruka Yoshihara 2012-12-13 19:15:44 +0900 (Thu, 13 Dec 2012) New Revision: 7c373497c05b1fc5f68e11832d77c06c845c95cc https://github.com/groonga/groonga-query-log/commit/7c373497c05b1fc5f68e11832d77c06c845c95cc Log: test: remove tempfile when an output of analyzer#run is returned Modified files: test/test-analyzer.rb Modified: test/test-analyzer.rb (+6 -5) =================================================================== --- test/test-analyzer.rb 2012-12-13 19:10:36 +0900 (5fbbf46) +++ test/test-analyzer.rb 2012-12-13 19:15:44 +0900 (93ef8e9) @@ -57,11 +57,12 @@ class AnalyzerTest < Test::Unit::TestCase private def run_analyzer(*arguments) - output_file = Tempfile.new("output.actual") - output = output_file.path - arguments << "--output" << output - @analyzer.run(*arguments) - File.read(output) + output = "" + Tempfile.open("output.actual") do |output| + arguments << "--output" << output.path + @analyzer.run(*arguments) + File.read(output.path) + end end def normalize_json(json_string) -------------- next part -------------- HTML����������������������������... Télécharger