summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c3
-rw-r--r--test/stringio/test_stringio.rb4
3 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index adb42996cf..1968060621 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 9 16:34:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/stringio/stringio.c (strio_close): don't raise on dobule
+ close for consistent to IO#close.
+
Mon Mar 09 06:44:48 2015 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.h: define struct SVAR for SVAR.
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index cca408fcb5..78988e194e 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -346,9 +346,6 @@ static VALUE
strio_close(VALUE self)
{
StringIO(self);
- if (CLOSED(self)) {
- rb_raise(rb_eIOError, "closed stream");
- }
RBASIC(self)->flags &= ~STRIO_READWRITE;
return Qnil;
}
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index 07d89d16e1..6ba1e25791 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -193,12 +193,12 @@ class TestStringIO < Test::Unit::TestCase
def test_close
f = StringIO.new("")
f.close
- assert_raise(IOError) { f.close }
+ assert_nil(f.close)
f = StringIO.new("")
f.close_read
f.close_write
- assert_raise(IOError) { f.close }
+ assert_nil(f.close)
ensure
f.close unless f.closed?
end