Fix .simplecov
exit status for integration tests.
This commit is contained in:
parent
81203d346c
commit
da8d91bd05
@ -30,8 +30,6 @@ SimpleCov.start do
|
|||||||
SimpleCov.print_error_status = false
|
SimpleCov.print_error_status = false
|
||||||
|
|
||||||
SimpleCov.at_exit do
|
SimpleCov.at_exit do
|
||||||
$stdout.reopen("/dev/null")
|
|
||||||
|
|
||||||
# Just save result, but don't write formatted output.
|
# Just save result, but don't write formatted output.
|
||||||
coverage_result = Coverage.result
|
coverage_result = Coverage.result
|
||||||
# TODO: this method is private, find a better way.
|
# TODO: this method is private, find a better way.
|
||||||
@ -39,7 +37,10 @@ SimpleCov.start do
|
|||||||
simplecov_result = SimpleCov::Result.new(coverage_result)
|
simplecov_result = SimpleCov::Result.new(coverage_result)
|
||||||
SimpleCov::ResultMerger.store_result(simplecov_result)
|
SimpleCov::ResultMerger.store_result(simplecov_result)
|
||||||
|
|
||||||
exit! SimpleCov.exit_status_from_exception || 0
|
# If an integration test raises a `SystemExit` exception on exit,
|
||||||
|
# exit immediately using the same status code to avoid reporting
|
||||||
|
# an error when expecting a non-successful exit status.
|
||||||
|
raise if $ERROR_INFO.is_a?(SystemExit)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
command_name "#{command_name} (#{$PROCESS_ID})"
|
command_name "#{command_name} (#{$PROCESS_ID})"
|
||||||
|
@ -13,7 +13,8 @@ RSpec.shared_context "integration test" do
|
|||||||
matcher :be_a_success do
|
matcher :be_a_success do
|
||||||
match do |actual|
|
match do |actual|
|
||||||
status = actual.is_a?(Proc) ? actual.call : actual
|
status = actual.is_a?(Proc) ? actual.call : actual
|
||||||
status.respond_to?(:success?) && status.success?
|
expect(status).to respond_to(:success?)
|
||||||
|
status.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
def supports_block_expectations?
|
def supports_block_expectations?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user