@@ -147,7 +147,7 @@ class RubyExeSpecs
147
147
@script = RubyExeSpecs . new
148
148
allow ( @script ) . to receive ( :` ) . and_return ( 'OUTPUT' )
149
149
150
- status_successful = double ( Process ::Status , exitstatus : 0 )
150
+ status_successful = double ( Process ::Status , exited? : true , exitstatus : 0 )
151
151
allow ( Process ) . to receive ( :last_status ) . and_return ( status_successful )
152
152
end
153
153
@@ -176,24 +176,24 @@ class RubyExeSpecs
176
176
code = "code"
177
177
options = { }
178
178
179
- status_failed = double ( Process ::Status , exitstatus : 4 )
179
+ status_failed = double ( Process ::Status , exited? : true , exitstatus : 4 )
180
180
allow ( Process ) . to receive ( :last_status ) . and_return ( status_failed )
181
181
182
182
expect {
183
183
@script . ruby_exe ( code , options )
184
184
} . to raise_error ( %r{Expected exit status is 0 but actual is 4 for command ruby_exe\( .+\) } )
185
185
end
186
186
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
188
188
code = "code"
189
189
options = { }
190
190
191
- status_failed = double ( Process ::Status , exitstatus : nil )
191
+ status_failed = double ( Process ::Status , exited? : false , signaled? : true , termsig : Signal . list . fetch ( 'TERM' ) )
192
192
allow ( Process ) . to receive ( :last_status ) . and_return ( status_failed )
193
193
194
194
expect {
195
195
@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\( .+\) } )
197
197
end
198
198
199
199
describe "with :dir option" do
@@ -236,7 +236,7 @@ class RubyExeSpecs
236
236
237
237
describe "with :exit_status option" do
238
238
before do
239
- status_failed = double ( Process ::Status , exitstatus : 4 )
239
+ status_failed = double ( Process ::Status , exited? : true , exitstatus : 4 )
240
240
allow ( Process ) . to receive ( :last_status ) . and_return ( status_failed )
241
241
end
242
242
0 commit comments