diff options
Diffstat (limited to 'test/ruby')
-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 |