diff --git a/ChangeLog b/ChangeLog index b85b760d20..e1b873e83d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 25 17:09:13 2014 Tanaka Akira + + * test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile) + invocation. + Sun May 25 16:54:06 2014 Tanaka Akira * test/lib/minitest/unit.rb: Use Thread.list instead of diff --git a/test/lib/minitest/unit.rb b/test/lib/minitest/unit.rb index f6176f403a..8eec245934 100644 --- a/test/lib/minitest/unit.rb +++ b/test/lib/minitest/unit.rb @@ -923,12 +923,12 @@ module MiniTest filter === m || filter === "#{suite}##{m}" } + live1 = live_thread_and_tempfile + assertions = filtered_test_methods.map { |method| inst = suite.new method inst._assertions = 0 - live1 = live_thread_and_tempfile - print "#{suite}##{method} = " if @verbose start_time = Time.now if @verbose @@ -938,7 +938,9 @@ module MiniTest print result puts if @verbose - check_tempfile_and_thread inst, live1 + live2 = live_thread_and_tempfile + check_tempfile_and_thread inst, live1, live2 + live1 = live2 inst._assertions } @@ -960,8 +962,7 @@ module MiniTest [live_threads, live_tempfiles] end - def check_tempfile_and_thread(inst, live1) - live2 = live_thread_and_tempfile + def check_tempfile_and_thread(inst, live1, live2) thread_finished = live1[0] - live2[0] if !thread_finished.empty? list = thread_finished.map {|t| ' ' + t.inspect }.sort.join