summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-25 15:50:24 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-25 15:50:24 +0000
commitfe9b92f14902e9a7521d1da8467ec9d932a5ce65 (patch)
tree1d6638ff57c908d341a2dc0b35ca4b154d7fe129 /test
parent4d93af26df1c322515e535d60cd5b0a66dcc222d (diff)
* process.c (rb_spawn_internal): new function to specify
default_close_others. (rb_spawn): specify default_close_others true. (rb_f_system): call rb_spawn_internal with default_close_others as false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb9
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)