summaryrefslogtreecommitdiff
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 04:28:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 04:28:03 +0000
commit65273e90410c3d2f304f7abcf9b77c7f771dfde0 (patch)
tree85b52066a864a358b9bdd75844096867e9895ec7 /test/ruby/test_process.rb
parentf3dbd84fe0be3f0b04b3f20b9bb6400b9bc90881 (diff)
test_process.rb: split a test
* test/ruby/test_process.rb (test_execopts_popen): split into 3 tests, no other redirections, stdio, and other fds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 80dc3446e5..a87eef677b 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -768,6 +768,11 @@ class TestProcess < Test::Unit::TestCase
IO.popen("#{RUBY} -e 'puts :foo'") {|io| assert_equal("foo\n", io.read) }
assert_raise(Errno::ENOENT) { IO.popen(["echo bar"]) {} } # assuming "echo bar" command not exist.
IO.popen(ECHO["baz"]) {|io| assert_equal("baz\n", io.read) }
+ }
+ end
+
+ def test_execopts_popen_stdio
+ with_tmpchdir {|d|
assert_raise(ArgumentError) {
IO.popen([*ECHO["qux"], STDOUT=>STDOUT]) {|io| }
}
@@ -777,7 +782,12 @@ class TestProcess < Test::Unit::TestCase
assert_raise(ArgumentError) {
IO.popen([*ECHO["fuga"], STDOUT=>"out"]) {|io| }
}
- skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
+ }
+ end
+
+ def test_execopts_popen_extra_fd
+ skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
+ with_tmpchdir {|d|
with_pipe {|r, w|
IO.popen([RUBY, '-e', 'IO.new(3, "w").puts("a"); puts "b"', 3=>w]) {|io|
assert_equal("b\n", io.read)