diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-14 07:13:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-14 07:13:11 +0000 |
commit | 9681409e3691037c11c19052295616454f74c936 (patch) | |
tree | ebb308e156ad0b3b74c4f65a9ff54d7c0b1da15c /test/ruby/test_io.rb | |
parent | ed586352292f331f2166205c0d7b99b69eab4ba4 (diff) | |
download | ruby-9681409e3691037c11c19052295616454f74c936.tar.gz |
* io.c (rb_io_initialize): check if the descriptor can be accessed
in the specified open mode. [ruby-dev:38571]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r-- | test/ruby/test_io.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 69e3666cff..8a5b878f3b 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1379,6 +1379,9 @@ class TestIO < Test::Unit::TestCase fd = IO.sysopen(t.path, "w") assert_kind_of(Integer, fd) + %w[r r+ w+ a+].each do |mode| + assert_raise(Errno::EINVAL, '[ruby-dev:38571]') {IO.new(fd, mode)} + end f = IO.new(fd, "w") f.write("FOO\n") f.close |