summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 05:01:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 05:01:18 +0000
commit640bcdf217f69d83e96483a59ae7f9af4d534f43 (patch)
treeacf57cfc4bcebf04751a99f8035f0a6b14e20691 /test/lib
parent70410163f55bacb7995204b8cc1b8d09dffe79fb (diff)
leakchecker.rb: get rid of uninitialized Tempfile
* test/lib/leakchecker.rb (LeakChecker#find_tempfiles): get rid of errors on uninitialized Tempfile, which can be left when Dir.tmpdir failed or by Tempfile.allocate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/leakchecker.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lib/leakchecker.rb b/test/lib/leakchecker.rb
index 355f93dc79..c0cf718635 100644
--- a/test/lib/leakchecker.rb
+++ b/test/lib/leakchecker.rb
@@ -114,7 +114,9 @@ class LeakChecker
if prev_count == count
[prev_count, []]
else
- tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t| t.path }
+ tempfiles = ObjectSpace.each_object(Tempfile).find_all {|t|
+ t.instance_variable_defined?(:@tmpfile) and t.path
+ }
[count, tempfiles]
end
end