Skip to content

Commit 60e807d

Browse files
authored
Merge pull request #384 from pocke/broken-with-segumentation-fault
Fix when RSpec exits by segmentation fault.
2 parents da1eb28 + 67ad756 commit 60e807d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/guard/rspec/rspec_process.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def _run
3232
Compat::UI.debug(format(msg, command, exit_code.inspect))
3333

3434
unless [0, Command::FAILURE_EXIT_CODE].include?(exit_code)
35-
msg = "Failed: %s (exit code: %d)"
36-
raise Failure, format(msg, command.inspect, exit_code)
35+
msg = "Failed: %s (exit code: %s)"
36+
raise Failure, format(msg, command.inspect, exit_code.inspect)
3737
end
3838
exit_code
3939
end

spec/lib/guard/rspec/rspec_process_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@
5252
end
5353
end
5454

55+
context "without any exit code" do
56+
let(:exit_code) { nil }
57+
58+
it "fails" do
59+
expect { subject }.
60+
to raise_error(Guard::RSpec::RSpecProcess::Failure, /Failed: /)
61+
end
62+
end
63+
5564
context "with the failure code for normal test failures" do
5665
let(:exit_code) { Guard::RSpec::Command::FAILURE_EXIT_CODE }
5766

0 commit comments

Comments
 (0)