Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit with code only if it's Numeric > 0 #302

Merged
merged 3 commits into from
Jun 15, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/simplecov/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
SimpleCov::LastRun.write(:result => {:covered_percent => covered_percent})
end

exit @exit_status # Force exit with stored status (see github issue #5)
# Force exit with stored status (see github issue #5)
# Unless it's nil or 0 (see github issue #281)
exit @exit_status if @exit_status.is_a?(Numeric) && @exit_status > 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if @exit_status && @exit_status > 0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, checked just now and SystemExit#status is a Fixnum

end

# Autoload config from ~/.simplecov if present
Expand Down