Skip to content

Commit

Permalink
Fix result collation
Browse files Browse the repository at this point in the history
Previously, collation was being made using `Hash#merge`, and the
`ResultMerger` was being passed an already (incorrectly) merged result.
  • Loading branch information
deivid-rodriguez committed Dec 9, 2019
1 parent 6a74816 commit 4fedabd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/simplecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def collate(result_filenames, profile = nil, &block)
self.running = true
self.pid = Process.pid

results = result_filenames.map { |filename| JSON.parse(File.read(filename)) || {} }.reduce(&:merge).map do |command_name, data|
results = result_filenames.map do |filename|
# Re-create each included instance of SimpleCov::Result from the stored run data.
SimpleCov::Result.from_hash(command_name => data)
SimpleCov::Result.from_hash(JSON.parse(File.read(filename)) || {})
end

# Use the ResultMerger to produce a single, merged result, ready to use.
Expand Down

0 comments on commit 4fedabd

Please sign in to comment.