diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-26 08:12:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-08-26 08:12:48 +0000 |
commit | febf2cefb3b69dd859b3c81e0512d0bae9b315ea (patch) | |
tree | 506cfc9c79be0e3963d46022de70aeadf230dda4 /test | |
parent | eec0176d149576bfc8dc90bedf502013752977b2 (diff) | |
download | ruby-febf2cefb3b69dd859b3c81e0512d0bae9b315ea.tar.gz |
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.rb | 9 |
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 |