1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-09-30 12:21:48 +02:00
parent ce986b41ca
commit 201d501640
17 changed files with 209 additions and 6 deletions

View file

@ -536,6 +536,15 @@ describe "Process.spawn" do
File.read(@name).should == "glarkbang"
end
it "closes STDERR in the child if :err => :close" do
File.open(@name, 'w') do |file|
-> do
code = "begin; STDOUT.puts 'out'; STDERR.puts 'hello'; rescue => e; puts 'rescued'; end"
Process.wait Process.spawn(ruby_cmd(code), :out => file, :err => :close)
end.should output_to_fd("out\nrescued\n", file)
end
end
# :close_others
platform_is_not :windows do