diff options
Diffstat (limited to 'test/ruby/test_syntax.rb')
-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 |