summaryrefslogtreecommitdiff
path: root/spec/mspec/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-06-26 14:50:13 +0200
committerBenoit Daloze <eregontp@gmail.com>2022-06-26 14:50:13 +0200
commitf616e816372d14e605879d2e43c7fbdda29ef837 (patch)
treea19720f6d0184d88e525a119acb6edd4ebf5d173 /spec/mspec/spec
parentef79f0a9e5b70b177d2fc5c9505ffd865f03382b (diff)
Update to ruby/mspec@78b5d86
Diffstat (limited to 'spec/mspec/spec')
-rw-r--r--spec/mspec/spec/helpers/ruby_exe_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/mspec/spec/helpers/ruby_exe_spec.rb b/spec/mspec/spec/helpers/ruby_exe_spec.rb
index 79ce55ca75..61225a2756 100644
--- a/spec/mspec/spec/helpers/ruby_exe_spec.rb
+++ b/spec/mspec/spec/helpers/ruby_exe_spec.rb
@@ -147,7 +147,7 @@ RSpec.describe Object, "#ruby_exe" do
@script = RubyExeSpecs.new
allow(@script).to receive(:`).and_return('OUTPUT')
- status_successful = double(Process::Status, exitstatus: 0)
+ status_successful = double(Process::Status, exited?: true, exitstatus: 0)
allow(Process).to receive(:last_status).and_return(status_successful)
end
@@ -176,7 +176,7 @@ RSpec.describe Object, "#ruby_exe" do
code = "code"
options = {}
- status_failed = double(Process::Status, exitstatus: 4)
+ status_failed = double(Process::Status, exited?: true, exitstatus: 4)
allow(Process).to receive(:last_status).and_return(status_failed)
expect {
@@ -184,16 +184,16 @@ RSpec.describe Object, "#ruby_exe" do
}.to raise_error(%r{Expected exit status is 0 but actual is 4 for command ruby_exe\(.+\)})
end
- it "shows in the exception message if exitstatus is nil (e.g., signal)" do
+ it "shows in the exception message if a signal killed the process" do
code = "code"
options = {}
- status_failed = double(Process::Status, exitstatus: nil)
+ status_failed = double(Process::Status, exited?: false, signaled?: true, termsig: Signal.list.fetch('TERM'))
allow(Process).to receive(:last_status).and_return(status_failed)
expect {
@script.ruby_exe(code, options)
- }.to raise_error(%r{Expected exit status is 0 but actual is nil for command ruby_exe\(.+\)})
+ }.to raise_error(%r{Expected exit status is 0 but actual is :SIGTERM for command ruby_exe\(.+\)})
end
describe "with :dir option" do
@@ -236,7 +236,7 @@ RSpec.describe Object, "#ruby_exe" do
describe "with :exit_status option" do
before do
- status_failed = double(Process::Status, exitstatus: 4)
+ status_failed = double(Process::Status, exited?: true, exitstatus: 4)
allow(Process).to receive(:last_status).and_return(status_failed)
end