diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-15 15:26:03 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-15 15:26:03 +0000 |
commit | 255955585c922ec5e303df184057b7781fcee345 (patch) | |
tree | ff295100b83381d8d4cf8689bf104b2f48d2092b /test/ruby/test_io.rb | |
parent | 0fce0b7ba1337b25d717fc39481eef556d247005 (diff) | |
download | ruby-255955585c922ec5e303df184057b7781fcee345.tar.gz |
* io.c (rb_io_close_m): Don't raise when the IO object is closed.
[ruby-core:67444] [Feature #10718]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 935ee24d83..7161be1a6e 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -3159,4 +3159,17 @@ End end end end + + def test_close_twice + open(__FILE__) {|f| + assert_equal(nil, f.close) + assert_equal(nil, f.close) + } + end + + def test_close_uninitialized + io = IO.allocate + assert_raise(IOError) { io.close } + end + end |