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
I don't like the suggested approach though - I think that method and the data available should always be the not rounded value. Rounding it there might introduce further surprises.
we could make a separate rounded value available (lots of duplication) or probably better provide a public method that does simplecov rounding on percentages and replace all round calls fir display with it.
Hi there,
Due to #679 fix, covered_percent in .last_run.json value is different from html formatter's one.
For examle,
covered_percent in .last_run.json shows
14.21
But, simplecov-html shows
14.22
In
simplecov-html
the coverage percentage is rounded by.round(2)
like below search results.https://github.com/simplecov-ruby/simplecov-html/search?q=.round%282%29
In contrast to it,
simplecov
is flooring its coverage percent like below.https://github.com/simplecov-ruby/simplecov/blob/main/lib/simplecov.rb#L291-L297
MY SUGGESTION
compute_percent
method Incoverage_statistics.rb
returns like this,SimpleCov.round_coverage(covered * 100.0 / total)
https://github.com/simplecov-ruby/simplecov/blob/main/lib/simplecov/coverage_statistics.rb#L47
Infos
0.19.1
0.12.3
ruby -e "puts RUBY_DESCRIPTION"
": ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]6.0.0
Thanks!
The text was updated successfully, but these errors were encountered: