diff options
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r-- | test/ruby/test_process.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index f3f3f9eb80..b45bfb9bb0 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -384,20 +384,16 @@ class TestProcess < Test::Unit::TestCase Process.wait Process.spawn(*ECHO["c"], STDERR=>STDOUT, STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]) assert_equal("c", File.read("out").chomp) File.open("out", "w") {|f| - Process.wait Process.spawn(*ECHO["d"], STDOUT=>f) + Process.wait Process.spawn(*ECHO["d"], f=>STDOUT, STDOUT=>f) assert_equal("d", File.read("out").chomp) } - opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]} - if /mswin|mingw/ !~ RUBY_PLATFORM - opts.merge(3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT) - end - Process.wait Process.spawn(*ECHO["e"], opts) + Process.wait Process.spawn(*ECHO["e"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644], + 3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT) assert_equal("e", File.read("out").chomp) - opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]} - if /mswin|mingw/ !~ RUBY_PLATFORM - opts.merge(3=>0, 4=>:in, 5=>STDIN, 6=>1, 7=>:out, 8=>STDOUT, 9=>2, 10=>:err, 11=>STDERR) - end - Process.wait Process.spawn(*ECHO["ee"], opts) + Process.wait Process.spawn(*ECHO["ee"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644], + 3=>0, 4=>:in, 5=>STDIN, + 6=>1, 7=>:out, 8=>STDOUT, + 9=>2, 10=>:err, 11=>STDERR) assert_equal("ee", File.read("out").chomp) if /mswin|mingw/ !~ RUBY_PLATFORM # passing non-stdio fds is not supported on Windows |