-
Notifications
You must be signed in to change notification settings - Fork 238
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
Always consider empty files as 100% tested #45
Conversation
@neonichu Can you add a test proving this works please? |
@@ -102,7 +102,11 @@ def rate_lines_tested | |||
end | |||
|
|||
def percentage_lines_tested | |||
rate_lines_tested * 100 | |||
if num_lines_testable == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know the line_rate should also be set to 1.0 under that condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@neonichu should we make that change too, for corbetura?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily. The cobertura output generator checks it as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Merging then!
This looks good, but let's add some tests like @kylef said |
I have updated the two existing tests which had zero-length files in them. Should've done that initially 😞 |
Always consider empty files as 100% tested
I think it is better to avoid "false positive" untested classes.