summaryrefslogtreecommitdiff
path: root/test/lib/minitest
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 08:15:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-25 08:15:08 +0000
commit540ffb3abdce5916a13cd2918609cf8cbd9a0a03 (patch)
tree3f0dad8b4def4230da1a339c2a35da88abc0cc35 /test/lib/minitest
parent70c15b19fad88dd1e836b08e53194d04c9945db4 (diff)
* test/lib/minitest/unit.rb: Less ObjectSpace.each_object(Tempfile)
invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/minitest')
-rw-r--r--test/lib/minitest/unit.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/lib/minitest/unit.rb b/test/lib/minitest/unit.rb
index f6176f4..8eec245 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