Module: SimpleCov::Combine::MethodsCombiner
| Relationships & Source Files | |
| Defined in: | lib/simplecov/combine/methods_combiner.rb |
Overview
::SimpleCov::Combine different method coverage results on a single file.
Should be called through SimpleCov.combine.
Class Method Summary
-
.combine(coverage_a, coverage_b) ⇒ Hash
mod_func
Return merged methods or the existing methods if other is missing.
Class Method Details
.combine(coverage_a, coverage_b) ⇒ Hash (mod_func)
Return merged methods or the existing methods if other is missing.
Method coverage is a flat hash mapping method identifiers to hit counts. Combining sums the hit counts for matching methods and preserves methods that only appear in one result.
# File 'lib/simplecov/combine/methods_combiner.rb', line 21
def combine(coverage_a, coverage_b) coverage_a.merge(coverage_b) { |_key, a_count, b_count| a_count + b_count } end