diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-17 06:44:28 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-17 06:44:28 +0000 |
commit | d9abe0513d913b1eb6e149ad9f610a694385e226 (patch) | |
tree | a4841882d0c7df6889c3559522ee2c0b6037b716 /test/ruby | |
parent | cfa3a72cc260edfc307d0abb405a70093a6c3127 (diff) |
merge revision(s) 24751:
* io.c (rb_io_binmode): check if closed regardless platforms.
[ruby-core:25363]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 19b4f0ebf6..b5e9b8ec06 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1,5 +1,6 @@ require 'test/unit' require 'tmpdir' +require 'tempfile' class TestIO < Test::Unit::TestCase def mkcdtmpdir @@ -28,4 +29,20 @@ class TestIO < Test::Unit::TestCase } } end + + def make_tempfile + t = Tempfile.new("foo") + t.binmode + t.puts "foo" + t.puts "bar" + t.puts "baz" + t.close + t + end + + def test_binmode_after_closed + t = make_tempfile + t.close + assert_raise(IOError) {t.binmode} + end end |