diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-09 09:32:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-09 09:32:47 +0000 |
commit | 8f6128303102d0b73eef15b4c02b62bfb1cb05f9 (patch) | |
tree | 0dc8a7b8ff6d47149760cebed34d4275adfcb1e7 /test | |
parent | 76515504d552d3677f81539c29ed5f558f0dc4f0 (diff) |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 1e988ddde7..475ee99a33 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -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 |