diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index d8113d7180..e68f1070e6 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -419,9 +419,9 @@ class TestProcess < Test::Unit::TestCase assert_equal("ba\n", r.read) } with_pipe {|r, w| - Process.wait spawn("echo bi >&#{w.fileno}") + Process.wait spawn("exec 2>/dev/null; echo bi >&#{w.fileno}") w.close - assert_equal("bi\n", r.read) + assert_equal("", r.read) } with_pipe {|r, w| Process.wait fork { exec("echo bu >&#{w.fileno}") } @@ -465,6 +465,11 @@ class TestProcess < Test::Unit::TestCase File.unlink("err") } with_pipe {|r, w| + Process.wait spawn("echo bi >&#{w.fileno}", :close_others=>false) + w.close + assert_equal("bi\n", r.read) + } + with_pipe {|r, w| Process.wait fork { exec("exec >/dev/null 2>err; echo mu >&#{w.fileno}", :close_others=>true) } w.close assert_equal("", r.read) |