1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd

if F_GETFL is not available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2008-10-28 11:23:52 +00:00
parent 7d934c47d1
commit 68b9bc4201

View file

@ -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)
if defined?(Fcntl::F_GETFL)
f = IO.for_fd(fd)
else
f = IO.for_fd(fd, 0666)
end
f.write("FOO\n")
f.close