Skip to content

Commit

Permalink
Fix merger of coverage when a file is not available in all of the res…
Browse files Browse the repository at this point in the history
…ultsets
  • Loading branch information
hanazuki committed Jul 13, 2016
1 parent 645703a commit cfab71d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/simplecov/merge_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ module HashMergeHelper
def merge_resultset(hash)
new_resultset = {}
(keys + hash.keys).each do |filename|
new_resultset[filename] = []
new_resultset[filename] = nil
end

new_resultset.each_key do |filename|
new_resultset[filename] = (self[filename] || []).extend(SimpleCov::ArrayMergeHelper).merge_resultset(hash[filename] || [])
result1 = self[filename]
result2 = hash[filename]
new_resultset[filename] =
(result1 && result2) ? result1.extend(ArrayMergeHelper).merge_resultset(result2) : (result1 || result2).dup
end
new_resultset
end
Expand Down

0 comments on commit cfab71d

Please sign in to comment.