summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index f5f49f3efae..de55abbd41b 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -1238,57 +1238,6 @@ class TestIO < Test::Unit::TestCase
end
end
- def test_O_CLOEXEC
- if !defined? File::CLOEXEC
- return
- end
-
- mkcdtmpdir do
- ary = []
- begin
- 10.times {
- ary.concat IO.pipe
- }
-
- normal_file = Tempfile.new("normal_file");
- assert_equal(false, normal_file.close_on_exec?)
- cloexec_file = Tempfile.new("cloexec_file", :mode => File::CLOEXEC);
- assert_equal(true, cloexec_file.close_on_exec?)
- arg, argw = IO.pipe
- argw.puts normal_file.fileno
- argw.puts cloexec_file.fileno
- argw.flush
- ret, retw = IO.pipe
-
- while (e = ary.shift) != nil
- e.close
- end
-
- spawn("ruby", "-e", <<-'End', :close_others=>false, :in=>arg, :out=>retw)
- begin
- puts IO.for_fd(gets.to_i).fileno
- puts IO.for_fd(gets.to_i).fileno
- rescue
- puts "nofile"
- ensure
- exit
- end
- End
- retw.close
- Process.wait
- assert_equal("#{normal_file.fileno}\nnofile\n", ret.read)
- ensure
- while (e = ary.shift) != nil
- e.close
- end
- arg.close unless !arg || arg.closed?
- argw.close unless !argw || argw.closed?
- ret.close unless !ret || ret.closed?
- retw.close unless !retw || retw.closed?
- end
- end
- end
-
def test_close_security_error
with_pipe do |r, w|
assert_raise(SecurityError) do