diff options
Diffstat (limited to 'spec/ruby/core/process/waitpid_spec.rb')
| -rw-r--r-- | spec/ruby/core/process/waitpid_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/core/process/waitpid_spec.rb b/spec/ruby/core/process/waitpid_spec.rb new file mode 100644 index 0000000000..a02147b663 --- /dev/null +++ b/spec/ruby/core/process/waitpid_spec.rb @@ -0,0 +1,14 @@ +require_relative '../../spec_helper' + +describe "Process.waitpid" do + it "returns nil when the process has not yet completed and WNOHANG is specified" do + cmd = platform_is(:windows) ? "timeout" : "sleep" + pid = spawn("#{cmd} 5") + begin + Process.waitpid(pid, Process::WNOHANG).should == nil + Process.kill("KILL", pid) + ensure + Process.wait(pid) + end + end +end |
