Skip to content

Commit

Permalink
Fix warning: instance variable @exit_status not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Sep 10, 2013
1 parent a3387f7 commit 3459c35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/simplecov/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@
#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
@exit_status = 0
end

SimpleCov.at_exit.call

if SimpleCov.result? # Result has been computed
covered_percent = SimpleCov.result.covered_percent.round(2)

if @exit_status.to_i == 0 # No other errors
if @exit_status == 0 # No other errors
@exit_status = if covered_percent < SimpleCov.minimum_coverage
$stderr.puts "Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%)." % \
[covered_percent, SimpleCov.minimum_coverage]
Expand Down

0 comments on commit 3459c35

Please sign in to comment.