summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-14 07:13:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-14 07:13:11 +0000
commit9681409e3691037c11c19052295616454f74c936 (patch)
treeebb308e156ad0b3b74c4f65a9ff54d7c0b1da15c /test
parented586352292f331f2166205c0d7b99b69eab4ba4 (diff)
* 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')
-rw-r--r--test/ruby/test_io.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 69e3666..8a5b878 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