Skip to content

Commit

Permalink
Fix when RSpec exits by segmentation fault.
Browse files Browse the repository at this point in the history
  • Loading branch information
pocke committed Jul 23, 2016
1 parent 2c8591b commit 67ad756
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/guard/rspec/rspec_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def _run
Compat::UI.debug(format(msg, command, exit_code.inspect))

unless [0, Command::FAILURE_EXIT_CODE].include?(exit_code)
msg = "Failed: %s (exit code: %d)"
raise Failure, format(msg, command.inspect, exit_code)
msg = "Failed: %s (exit code: %s)"
raise Failure, format(msg, command.inspect, exit_code.inspect)
end
exit_code
end
Expand Down
9 changes: 9 additions & 0 deletions spec/lib/guard/rspec/rspec_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
end
end

context "without any exit code" do
let(:exit_code) { nil }

it "fails" do
expect { subject }.
to raise_error(Guard::RSpec::RSpecProcess::Failure, /Failed: /)
end
end

context "with the failure code for normal test failures" do
let(:exit_code) { Guard::RSpec::Command::FAILURE_EXIT_CODE }

Expand Down

0 comments on commit 67ad756

Please sign in to comment.