Permalink
Browse files

Close Tempfile

Fix Tempfile leak.
  • Loading branch information...
1 parent 446b0f9 commit 023d3e37bfce50df28ae25093b2e3240420634db @nobu nobu committed on GitHub Aug 23, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 test/psych/test_psych.rb
@@ -145,8 +145,9 @@ def test_load_file
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

0 comments on commit 023d3e3

Please sign in to comment.