summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-10 03:36:25 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-10 03:36:25 +0000
commit9d742d7365cfde9317b8acf5c24c0b22bc916f9b (patch)
treeae31f61cc89de5ef91f5d3649ffd5748858aa720 /test
parent07b140ecb19dfefb0eef7eb12c5ecbe8d11acb5b (diff)
merge revision(s) 47288: [Backport #10153]
* 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/branches/ruby_2_0_0@47503 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 f4b65f7f36..89e347d2b3 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2800,4 +2800,13 @@ End
ensure
t.kill
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