mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
f3dbd84fe0
commit
65273e9041
1 changed files with 11 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue