Skip to content

Commit 9216ac4

Browse files
committed
Use a SpecExpectationNotMetError for unexpected exit status
* Removes the `RuntimeError: ` prefix and reports it as as FAILED instead of ERROR.
1 parent bd27e73 commit 9216ac4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/mspec/lib/mspec/helpers/ruby_exe.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def ruby_exe(code = :not_given, opts = {})
145145
exit_status = Process.last_status.exitstatus
146146
if exit_status != expected_status
147147
formatted_output = output.lines.map { |line| " #{line}" }.join
148-
raise "Expected exit status is #{expected_status.inspect} but actual is #{exit_status.inspect} for command ruby_exe(#{command.inspect})\nOutput:\n#{formatted_output}"
148+
raise SpecExpectationNotMetError,
149+
"Expected exit status is #{expected_status.inspect} but actual is #{exit_status.inspect} for command ruby_exe(#{command.inspect})\nOutput:\n#{formatted_output}"
149150
end
150151

151152
output

0 commit comments

Comments
 (0)