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

SimpleCov.results doesn't handle :nocov: #146

Closed
J5 opened this issue Jun 21, 2012 · 4 comments
Closed

SimpleCov.results doesn't handle :nocov: #146

J5 opened this issue Jun 21, 2012 · 4 comments
Labels

Comments

@J5
Copy link

J5 commented Jun 21, 2012

We use the results from simplecov to error out if we are not at 100% coverage. However if we put :nocov: lines in our source code the results will show < 100% coverage corresponding to the number of lines marked by nocov. The report output by SimpleCov-html does show 100% coverage.

While looking through simplecov's sources I noticed that SourceFile has facilities to account for this but Result seems to be working on a raw hash of integers and counting skipped lines as missed in the missed_line method. By overriding the missed_line method and looking for :nocov: tokens I have been able to workaround the issue but I'm assuming Result needs to be completely refactored:

class SimpleCov::Result
def missed_lines
return @missed_lines if defined? @missed_lines
@missed_lines = 0
@files.each do |file|
@missed_lines += file.missed_lines.count
end
@missed_lines
end
end

@dvgica
Copy link

dvgica commented Dec 4, 2012

+1

I would like to see this fixed sooner rather than later.

@dedman
Copy link

dedman commented Dec 16, 2012

Just hit this problem as well, would be great to have a fix!

@ghost
Copy link

ghost commented Dec 21, 2012

+1

@ronwsmith
Copy link

+1, this is causing issues for us when using the minimum_coverage feature and lines are added to nocov methods (and the command line coverage drops because of this bug).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants