diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 19:50:06 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-28 19:50:06 +0000 |
commit | 4fbb9aa3cb6c31ec128bfb31f59efa66d66adba4 (patch) | |
tree | 84a654b260261fe172f2584f60b3ba93e59f841d /spec/ruby/core/process | |
parent | b864bd05bff2a61d55b08deb92e969f9fa55e07c (diff) | |
download | ruby-4fbb9aa3cb6c31ec128bfb31f59efa66d66adba4.tar.gz |
Update to ruby/spec@6f38a82
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/process')
-rw-r--r-- | spec/ruby/core/process/status/exitstatus_spec.rb | 14 | ||||
-rw-r--r-- | spec/ruby/core/process/status/termsig_spec.rb | 12 |
2 files changed, 25 insertions, 1 deletions
diff --git a/spec/ruby/core/process/status/exitstatus_spec.rb b/spec/ruby/core/process/status/exitstatus_spec.rb index 9a0be6a08d..cd46b2081f 100644 --- a/spec/ruby/core/process/status/exitstatus_spec.rb +++ b/spec/ruby/core/process/status/exitstatus_spec.rb @@ -1,7 +1,6 @@ require_relative '../../../spec_helper' describe "Process::Status#exitstatus" do - before :each do ruby_exe("exit(42)") end @@ -10,4 +9,17 @@ describe "Process::Status#exitstatus" do $?.exitstatus.should == 42 end + describe "for a child that raised SignalException" do + before :each do + ruby_exe("raise SignalException, 'SIGTERM'") + end + + platform_is_not :windows do + # The exitstatus is not set in these cases. See the termsig_spec + # for info on where the signal number (SIGTERM) is available. + it "returns nil" do + $?.exitstatus.should == nil + end + end + end end diff --git a/spec/ruby/core/process/status/termsig_spec.rb b/spec/ruby/core/process/status/termsig_spec.rb index db0765477d..1482d27146 100644 --- a/spec/ruby/core/process/status/termsig_spec.rb +++ b/spec/ruby/core/process/status/termsig_spec.rb @@ -13,6 +13,18 @@ describe "Process::Status#termsig" do end end + describe "for a child that raised SignalException" do + before :each do + ruby_exe("raise SignalException, 'SIGTERM'") + end + + platform_is_not :windows do + it "returns the signal" do + $?.termsig.should == Signal.list["TERM"] + end + end + end + describe "for a child that was sent a signal" do before :each do |