diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-21 04:28:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-21 04:28:03 +0000 |
commit | 1bca853889fc3bd80509fcc40e6657538ba3df58 (patch) | |
tree | 85b52066a864a358b9bdd75844096867e9895ec7 /test/ruby/test_process.rb | |
parent | 8d830c0b73d4d528349be5660990166f1c6eab2a (diff) | |
download | ruby-1bca853889fc3bd80509fcc40e6657538ba3df58.tar.gz |
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.rb | 12 |
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) |