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

coverage.rb: Fix handling of 0 total resources #802

Closed
wants to merge 1 commit into from

Conversation

raemer
Copy link
Contributor

@raemer raemer commented Aug 19, 2020

If there are 0 total resources, a percentage of NaN was generated as
division by zero was not prevented. This checks if the divisor is zero
and sets the percentage to 100 if so.

If there are 0 total resources, a percentage of NaN was generated as
division by zero was not prevented. This checks if the divisor is zero
and sets the percentage to 100 if so.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 85.46% when pulling 1ad8bc4 on raemer:master into ae0b5b0 on rodjek:master.

@raemer
Copy link
Contributor Author

raemer commented Aug 19, 2020

fixes #803

@daianamezdrea
Copy link

Hi @raemer, can you explain me a little bit the context of this change? I know in some cases a limit of coverage is imposed, is the same situation here ?

@scotje scotje added this to the 2.8.x milestone Oct 14, 2020
@scotje
Copy link
Collaborator

scotje commented Oct 15, 2020

Hi @raemer, thanks for your contribution! I've refactored this slightly and added a unit test in #805. Once CI passes there I will merge that PR in favor of this one.

@scotje scotje closed this Oct 15, 2020
@scotje scotje removed this from the 2.8.x milestone Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants