SimpleCov v0.18.0 Release Notes
Release Date: 2020-01-28 // about 4 years ago-
๐ Huge release! Highlights are support for branch coverage (Ruby 2.5+) and dropping support for EOL'ed Ruby versions (< 2.4). Please also read the other beta patch notes.
๐ง You can run with branch coverage by putting
enable_coverage :branch
into your SimpleCov configuration (like theSimpleCov.start do .. end
block)โจ Enhancements
- You can now define the minimum expected coverage by criterion like
minimum_coverage line: 90, branch: 80
- ๐ Memoized some internal data structures that didn't change to reduce SimpleCov overhead
- Both
FileList
andSourceFile
now have acoverage
method that returns a hash that points from a coverage criterion to aCoverageStatistics
object for uniform access to overall coverage statistics for both line and branch coverage
๐ Bugfixes
- we were losing precision by rounding the covered strength early, that has been removed. For Formatters this also means that you may need to round it yourself now.
- โ Removed an inconsistency in how we treat skipped vs. irrelevant lines (see #565) - SimpleCov's definition of 100% is now "You covered everything that you could" so if coverage is 0/0 that's counted as a 100% no matter if the lines were irrelevant or ignored/skipped
Noteworthy
FileList
stopped inheriting from Array, it includes Enumerable so if you didn't use Array specific methods on it in formatters you should be fine- ๐ We needed to change an internal file format, which we use for merging across processes, to accommodate branch coverage. Sadly CodeClimate chose to use this file to report test coverage. Until a resolution is found the code climate test reporter won't work with SimpleCov for 0.18+, see this issue on the test reporter.
- You can now define the minimum expected coverage by criterion like