summaryrefslogtreecommitdiffstats
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
commit05cbca84fb81d290bc6b9a07f6cb5d2cb81111d5 (patch)
treeebb308e156ad0b3b74c4f65a9ff54d7c0b1da15c /test
parent51ba626181e8dad48c4481eca99496e31de983f1 (diff)
downloadruby-05cbca84fb81d290bc6b9a07f6cb5d2cb81111d5.tar.gz
ruby-05cbca84fb81d290bc6b9a07f6cb5d2cb81111d5.tar.xz
ruby-05cbca84fb81d290bc6b9a07f6cb5d2cb81111d5.zip
* io.c (rb_io_initialize): check if the descriptor can be accessed
in the specified open mode. [ruby-dev:38571] git-svn-id: http://svn.ruby-lang.org/repos/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 69e3666cf..8a5b878f3 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