mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
stringio.c: don't raise after close
* ext/stringio/stringio.c (strio_close): don't raise on dobule close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89bfc9b70b
commit
f75fe0bcc7
3 changed files with 11 additions and 6 deletions
|
@ -207,7 +207,7 @@ class TestStringIO < Test::Unit::TestCase
|
|||
f = StringIO.new("")
|
||||
f.close_read
|
||||
assert_raise(IOError) { f.read }
|
||||
assert_raise(IOError) { f.close_read }
|
||||
assert_nothing_raised(IOError) {f.close_read}
|
||||
f.close
|
||||
|
||||
f = StringIO.new("", "w")
|
||||
|
@ -221,7 +221,7 @@ class TestStringIO < Test::Unit::TestCase
|
|||
f = StringIO.new("")
|
||||
f.close_write
|
||||
assert_raise(IOError) { f.write("foo") }
|
||||
assert_raise(IOError) { f.close_write }
|
||||
assert_nothing_raised(IOError) {f.close_write}
|
||||
f.close
|
||||
|
||||
f = StringIO.new("", "r")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue