Skip to content

Commit 78b5d86

Browse files
committed
Update specs
1 parent d3bdbf5 commit 78b5d86

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/helpers/ruby_exe_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class RubyExeSpecs
147147
@script = RubyExeSpecs.new
148148
allow(@script).to receive(:`).and_return('OUTPUT')
149149

150-
status_successful = double(Process::Status, exitstatus: 0)
150+
status_successful = double(Process::Status, exited?: true, exitstatus: 0)
151151
allow(Process).to receive(:last_status).and_return(status_successful)
152152
end
153153

@@ -176,24 +176,24 @@ class RubyExeSpecs
176176
code = "code"
177177
options = {}
178178

179-
status_failed = double(Process::Status, exitstatus: 4)
179+
status_failed = double(Process::Status, exited?: true, exitstatus: 4)
180180
allow(Process).to receive(:last_status).and_return(status_failed)
181181

182182
expect {
183183
@script.ruby_exe(code, options)
184184
}.to raise_error(%r{Expected exit status is 0 but actual is 4 for command ruby_exe\(.+\)})
185185
end
186186

187-
it "shows in the exception message if exitstatus is nil (e.g., signal)" do
187+
it "shows in the exception message if a signal killed the process" do
188188
code = "code"
189189
options = {}
190190

191-
status_failed = double(Process::Status, exitstatus: nil)
191+
status_failed = double(Process::Status, exited?: false, signaled?: true, termsig: Signal.list.fetch('TERM'))
192192
allow(Process).to receive(:last_status).and_return(status_failed)
193193

194194
expect {
195195
@script.ruby_exe(code, options)
196-
}.to raise_error(%r{Expected exit status is 0 but actual is nil for command ruby_exe\(.+\)})
196+
}.to raise_error(%r{Expected exit status is 0 but actual is :SIGTERM for command ruby_exe\(.+\)})
197197
end
198198

199199
describe "with :dir option" do
@@ -236,7 +236,7 @@ class RubyExeSpecs
236236

237237
describe "with :exit_status option" do
238238
before do
239-
status_failed = double(Process::Status, exitstatus: 4)
239+
status_failed = double(Process::Status, exited?: true, exitstatus: 4)
240240
allow(Process).to receive(:last_status).and_return(status_failed)
241241
end
242242

0 commit comments

Comments
 (0)