test_syntax.rb: fix tempfile leaks

* test/ruby/test_syntax.rb (test_must_ascii_compatible),
  (test_script_lines): ensure to close temporary files.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-08-09 09:32:47 +00:00
parent 76515504d5
commit 8f61283031

View File

@ -37,7 +37,8 @@ class TestSyntax < Test::Unit::TestCase
make_tmpsrc(f, "# -*- coding: #{enc.name} -*-")
assert_raise(ArgumentError, enc.name) {load(f.path)}
end
f.close!
ensure
f.close! if f
end
def test_script_lines
@ -53,7 +54,8 @@ class TestSyntax < Test::Unit::TestCase
assert_equal([enc, enc], debug_lines[f.path].map(&:encoding), bug4361)
end
end
f.close!
ensure
f.close! if f
end
def test_newline_in_block_parameters