Module: Mutant::Result::Coverage

Included in:
Env, Subject
Defined in:
lib/mutant/result.rb

Overview

Coverage mixin

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(host) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Hook called when module gets included

Parameters:

  • host (Class, Module)

Returns:

  • (undefined)

28
29
30
31
32
# File 'lib/mutant/result.rb', line 28

def self.included(host)
  super

  host.memoize(:coverage)
end

Instance Method Details

#coverageRational

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return coverage

Returns:

  • (Rational)

14
15
16
17
18
# File 'lib/mutant/result.rb', line 14

def coverage
  return Rational(0) if amount_mutation_results.zero?

  Rational(amount_mutations_killed, amount_mutation_results)
end