aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-23 01:34:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-23 01:34:42 +0000
commitafa2fcfcb565b14f91967216f1790da67b3c42ae (patch)
treeb1af090d1a73912f175c70b25f1f64994a6e07ad /test
parent98aff0edce3d8f6126787f4b16eba5e8194fc2db (diff)
downloadruby-afa2fcfcb565b14f91967216f1790da67b3c42ae.tar.gz
test_psych.rb: close Tempfile
* test/psych/test_psych.rb (test_load_file_with_fallback): fix Tempfile leak. https://github.com/tenderlove/psych/pull/288 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 508519b012..0e769274fd 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -145,8 +145,9 @@ class TestPsych < Psych::TestCase
end
def test_load_file_with_fallback
- t = Tempfile.create(['empty', 'yml'])
- assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+ Tempfile.create(['empty', 'yml']) {|t|
+ assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+ }
end
def test_parse_file