ruby-changes:8463
From: usa <ko1@a...>
Date: Tue, 28 Oct 2008 20:23:59 +0900 (JST)
Subject: [ruby-changes:8463] Ruby:r19995 (trunk): * test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd
usa 2008-10-28 20:23:52 +0900 (Tue, 28 Oct 2008) New Revision: 19995 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19995 Log: * test/ruby/test_io.rb (test_sysopen): should specify the mode of IO::for_fd if F_GETFL is not available. Modified files: trunk/test/ruby/test_io.rb Index: test/ruby/test_io.rb =================================================================== --- test/ruby/test_io.rb (revision 19994) +++ test/ruby/test_io.rb (revision 19995) @@ -1,5 +1,6 @@ require 'test/unit' require 'tmpdir' +require "fcntl" require 'io/nonblock' require 'socket' require 'stringio' @@ -722,6 +723,7 @@ 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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/