diff options
author | Benoit Daloze <[email protected]> | 2022-04-25 14:53:54 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2022-04-25 14:53:54 +0200 |
commit | 45cf4f218728a15eb36d14a6c9912086525f5e3f (patch) | |
tree | 2aa93fadcb904c226f722dde47827098b87a9846 /spec/ruby/core/process | |
parent | 6ae81d49b52563a6720d666a6118ffa6e484f398 (diff) |
Update to ruby/spec@3affe1e
Diffstat (limited to 'spec/ruby/core/process')
-rw-r--r-- | spec/ruby/core/process/wait2_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/process/wait2_spec.rb b/spec/ruby/core/process/wait2_spec.rb index 6eb7fc6d06..673d3cdb9d 100644 --- a/spec/ruby/core/process/wait2_spec.rb +++ b/spec/ruby/core/process/wait2_spec.rb @@ -33,4 +33,13 @@ describe "Process.wait2" do -> { Process.wait2 }.should raise_error(Errno::ECHILD) -> { Process.wait2 }.should raise_error(StandardError) end + + it "returns nil if the child process is still running when given the WNOHANG flag" do + IO.popen(ruby_cmd('STDIN.getbyte'), "w") do |io| + pid, status = Process.wait2(io.pid, Process::WNOHANG) + pid.should be_nil + status.should be_nil + io.write('a') + end + end end |