Skip to content

Commit

Permalink
Bugfix maximum coverage drop with old .last_run file
Browse files Browse the repository at this point in the history
  • Loading branch information
petertellgren authored and PragTob committed Jan 9, 2021
1 parent 120d0ea commit 10c1dff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions features/maximum_coverage_drop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Feature:
require 'simplecov'
SimpleCov.start do
add_filter 'test.rb'
maximum_coverage_drop 0
end
"""
And the file "coverage/.last_run.json" with:
Expand Down
2 changes: 1 addition & 1 deletion lib/simplecov/exit_codes/maximum_coverage_drop_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def compute_coverage_drop_data
def last_coverage(criterion)
last_coverage_percent = last_run[:result][criterion]

if !last_coverage_percent && criterion == "line"
if !last_coverage_percent && criterion == :line
last_run[:result][:covered_percent]
else
last_coverage_percent
Expand Down

0 comments on commit 10c1dff

Please sign in to comment.