You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
+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).
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
The text was updated successfully, but these errors were encountered: