Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix when RSpec exits by segmentation fault. #384

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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