summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-13 06:03:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-13 06:03:25 +0000
commit89bfc9b70b05ac598d24bb712222b79fb9af1880 (patch)
tree160c5a58d96db412e5d8c99d90cccdf66b29d06d /test
parent3338bc99e5163813cfe129844bcf397a77d4b916 (diff)
io.c: don't raise after close
* io.c (rb_io_close_read, rb_io_close_write): don't raise after close same as IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49961 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 600373a06c..81b99d55d1 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1364,6 +1364,9 @@ class TestIO < Test::Unit::TestCase
f.close_read
f.write "foobarbaz"
assert_raise(IOError) { f.read }
+ assert_nothing_raised(IOError) {f.close_read}
+ assert_nothing_raised(IOError) {f.close}
+ assert_nothing_raised(IOError) {f.close_read}
end
end
@@ -1371,6 +1374,9 @@ class TestIO < Test::Unit::TestCase
with_pipe do |r, w|
r.close_read
assert_raise(Errno::EPIPE) { w.write "foobarbaz" }
+ assert_nothing_raised(IOError) {r.close_read}
+ assert_nothing_raised(IOError) {r.close}
+ assert_nothing_raised(IOError) {r.close_read}
end
end
@@ -1398,6 +1404,9 @@ class TestIO < Test::Unit::TestCase
f.write "foobarbaz"
f.close_write
assert_equal("foobarbaz", f.read)
+ assert_nothing_raised(IOError) {f.close_write}
+ assert_nothing_raised(IOError) {f.close}
+ assert_nothing_raised(IOError) {f.close_write}
end
end