Module: SimpleCov::HashMergeHelper

Defined in:
lib/simplecov/merge_helpers.rb

Instance Method Summary collapse

Instance Method Details

#merge_resultset(hash) ⇒ Object

Merges the given Coverage.result hash with self


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/simplecov/merge_helpers.rb', line 25

def merge_resultset(hash)
  new_resultset = {}
  (self.keys + hash.keys).each do |filename|
    new_resultset[filename] = []
  end

  new_resultset.each do |filename, data|
    new_resultset[filename] = (self[filename] || []).merge_resultset(hash[filename] || [])
  end
  new_resultset
end