123456789_123456789_123456789_123456789_123456789_

Module: SimpleCov::Combine

Overview

Functionally for combining coverage results

Class Method Summary

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.

[ GitHub ]

  
# 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)

[ GitHub ]

  
# 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