Module: SimpleCov::Combine
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Defined in: | lib/simplecov/combine.rb, lib/simplecov/combine/branches_combiner.rb, lib/simplecov/combine/files_combiner.rb, lib/simplecov/combine/lines_combiner.rb, lib/simplecov/combine/results_combiner.rb |
Overview
Functionally for combining coverage results
Class Method Summary
-
.combine(combiner_module, coverage_a, coverage_b) ⇒ Hash
mod_func
Combine
two coverage based on the given combiner_module. - .empty_coverage?(coverage_a, coverage_b) ⇒ Boolean mod_func
- .existing_coverage(coverage_a, coverage_b) mod_func
Class Method Details
.combine(combiner_module, coverage_a, coverage_b) ⇒ Hash
(mod_func)
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.
# 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
.empty_coverage?(coverage_a, coverage_b) ⇒ Boolean
(mod_func)
# File 'lib/simplecov/combine.rb', line 22
def empty_coverage?(coverage_a, coverage_b) !(coverage_a && coverage_b) end
.existing_coverage(coverage_a, coverage_b) (mod_func)
[ GitHub ]# File 'lib/simplecov/combine.rb', line 26
def existing_coverage(coverage_a, coverage_b) coverage_a || coverage_b end