From 3459c3530ba925967613719a79df9bac813c870e Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Tue, 10 Sep 2013 22:47:49 +0200 Subject: [PATCH] Fix warning: instance variable @exit_status not initialized --- lib/simplecov/defaults.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/simplecov/defaults.rb b/lib/simplecov/defaults.rb index 5b85de20..0bc73f1d 100644 --- a/lib/simplecov/defaults.rb +++ b/lib/simplecov/defaults.rb @@ -47,6 +47,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 + @exit_status = 0 end SimpleCov.at_exit.call @@ -54,7 +56,7 @@ 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]