From 79b7e6598e2b9fb29690e0d7bab6186ff9e7f594 Mon Sep 17 00:00:00 2001 From: Jordan Rogers-Smith Date: Mon, 6 Jan 2014 22:30:38 +0000 Subject: [PATCH] potential fix for issue #262, all tests still pass and error no longer appears in guard --- lib/simplecov/defaults.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/simplecov/defaults.rb b/lib/simplecov/defaults.rb index 0b951ab6..e8ca7c2b 100644 --- a/lib/simplecov/defaults.rb +++ b/lib/simplecov/defaults.rb @@ -46,9 +46,8 @@ # otherwise set a non-zero status representing termination by some other exception # (see github issue 41) @exit_status = $!.is_a?(SystemExit) ? $!.status : SimpleCov::ExitCodes::EXCEPTION - else # Store the exit status of the test run since it goes away after calling the at_exit proc... - @exit_status = SimpleCov::ExitCodes::SUCCESS + end SimpleCov.at_exit.call @@ -77,7 +76,7 @@ SimpleCov::LastRun.write(:result => {:covered_percent => covered_percent}) end - exit @exit_status # Force exit with stored status (see github issue #5) + exit @exit_status if @exit_status # Force exit with stored status (see github issue #5) end # Autoload config from ~/.simplecov if present