Skip to content

Commit

Permalink
Merge pull request #384 from pocke/broken-with-segumentation-fault
Browse files Browse the repository at this point in the history
Fix when RSpec exits by segmentation fault.
  • Loading branch information
e2 committed Jul 29, 2016
2 parents da1eb28 + 67ad756 commit 60e807d
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 60e807d

Please sign in to comment.