diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-28 11:23:52 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-28 11:23:52 +0000 |
| commit | c56e5e5d0f2fc57486d00e7c9ac0492332a3c2f1 (patch) | |
| tree | 568de2046d635152ac71f8de6050ccaaf9d1d356 /test/ruby | |
| parent | f3bfa547ed1503c231f99f475d900166f6a73c12 (diff) | |
| download | ruby-c56e5e5d0f2fc57486d00e7c9ac0492332a3c2f1.tar.gz ruby-c56e5e5d0f2fc57486d00e7c9ac0492332a3c2f1.tar.xz ruby-c56e5e5d0f2fc57486d00e7c9ac0492332a3c2f1.zip | |
* test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd
if F_GETFL is not available.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index ebf158b39..34a8d017c 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1,5 +1,6 @@ require 'test/unit' require 'tmpdir' +require "fcntl" require 'io/nonblock' require 'socket' require 'stringio' @@ -722,6 +723,7 @@ class TestIO < Test::Unit::TestCase end def test_write_nonblock + skip "IO#write_nonblock is not supported on file/pipe." if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM pipe(proc do |w| w.write_nonblock(1) w.close @@ -1052,7 +1054,11 @@ class TestIO < Test::Unit::TestCase fd = IO.sysopen(t.path, "w", 0666) assert_kind_of(Integer, fd) - f = IO.for_fd(fd) + if defined?(Fcntl::F_GETFL) + f = IO.for_fd(fd) + else + f = IO.for_fd(fd, 0666) + end f.write("FOO\n") f.close |
