module SimpleCov::Combine
Functionally for combining coverage results
Public Instance Methods
Source
# File lib/simplecov/combine.rb, line 16 def combine(combiner_module, coverage_a, coverage_b) return existing_coverage(coverage_a, coverage_b) if empty_coverage?(coverage_a, coverage_b) combiner_module.combine(coverage_a, coverage_b) end
Combine
two coverage based on the given combiner_module.
Combiners should always be called through this interface, as it takes care of short-circuiting of one of the coverages is nil.
@return [Hash]
Source
# File lib/simplecov/combine.rb, line 22 def empty_coverage?(coverage_a, coverage_b) !(coverage_a && coverage_b) end
Source
# File lib/simplecov/combine.rb, line 26 def existing_coverage(coverage_a, coverage_b) coverage_a || coverage_b end