diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2016-08-23 10:31:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 10:31:17 +0900 |
commit | 023d3e37bfce50df28ae25093b2e3240420634db (patch) | |
tree | 61656696ee76ff763b60aafa41c695726b2eef4d | |
parent | 446b0f905b7949a74395d6265f864d56c9a0b2c4 (diff) | |
download | psych-023d3e37bfce50df28ae25093b2e3240420634db.tar.gz |
Close Tempfile
Fix Tempfile leak.
-rw-r--r-- | test/psych/test_psych.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 508519b..0e76927 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 |