diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-04 21:29:29 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-04 21:29:29 +0000 |
| commit | d24f4c0fe3594a1e2fef7cfbef521d71cb4f0abf (patch) | |
| tree | 9c6bd5c80fe4b570cf13f792632b33908002e1cb /test/ruby | |
| parent | 643462810e02bd3059d746104463170e800b6d64 (diff) | |
* 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@24751 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 6e69f14437..7137b5f772 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 @@ -17,4 +18,20 @@ class TestIO < Test::Unit::TestCase assert_equal("\377", r.gets("\377"), "[ruby-dev:24460]") r.close 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 |
