Skip to content

Commit

Permalink
Merge pull request #242 from sferik/fix_warnings
Browse files Browse the repository at this point in the history
Fix warning: instance variable @exit_status not initialized
  • Loading branch information
colszowka committed Sep 11, 2013
2 parents a3387f7 + 3459c35 commit cbd2da9
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 cbd2da9

Please sign in to comment.