summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-26 08:12:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-26 08:12:48 +0000
commitfebf2cefb3b69dd859b3c81e0512d0bae9b315ea (patch)
tree506cfc9c79be0e3963d46022de70aeadf230dda4 /test
parenteec0176d149576bfc8dc90bedf502013752977b2 (diff)
io.c: do not swallow exceptions at end of block
* io.c (io_close): ignore only "closed stream" IOError and NoMethodError, do not swallow other exceptions at the end of block. [ruby-core:64463] [Bug #10153] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 5ff07741dc..126100e096 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3065,4 +3065,13 @@ End
assert_raise(RuntimeError) { t.join }
}
end
+
+ def test_exception_at_close
+ bug10153 = '[ruby-core:64463] [Bug #10153] exception in close at the end of block'
+ assert_raise(Errno::EBADF, bug10153) do
+ IO.pipe do |r, w|
+ assert_nothing_raised {IO.open(w.fileno) {}}
+ end
+ end
+ end
end