Class: Mutant::Runner::Config
- Inherits:
-
Mutant::Runner
- Object
- Mutant::Runner
- Mutant::Runner::Config
- Defined in:
- lib/mutant/runner/config.rb
Overview
Runner for object config
Constant Summary collapse
- COVERAGE_PRECISION =
The expected coverage precision
1
Constants inherited from Mutant::Runner
Instance Attribute Summary collapse
-
#subjects ⇒ Enumerable<Runner::Subject>
readonly
private
Return subject runners.
Attributes inherited from Mutant::Runner
Class Method Summary collapse
-
.run(config) ⇒ Runner
private
Run runner for object.
Instance Method Summary collapse
-
#amount_kills ⇒ Fixnum
private
Return amount of kills.
-
#amount_mutations ⇒ Fixnum
private
Return amount of mutations.
-
#coverage ⇒ Float
private
Return coverage.
-
#failed_subjects ⇒ Enumerable<Subject>
private
Return failed subjects.
-
#mutations ⇒ Array<Mutation>
private
Return mutations.
-
#strategy ⇒ Strategy
private
Return strategy.
-
#success? ⇒ true, false
private
Test if run was successful.
Methods inherited from Mutant::Runner
#initialize, #running?, #runtime, #stop?
Constructor Details
This class inherits a constructor from Mutant::Runner
Instance Attribute Details
#subjects ⇒ Enumerable<Runner::Subject> (readonly)
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 subject runners
33 34 35 |
# File 'lib/mutant/runner/config.rb', line 33 def subjects @subjects end |
Class Method Details
.run(config) ⇒ Runner
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.
Run runner for object
22 23 24 25 |
# File 'lib/mutant/runner/config.rb', line 22 def self.run(config) handler = lookup(config.class) handler.new(config) end |
Instance Method Details
#amount_kills ⇒ Fixnum
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 amount of kills
89 90 91 |
# File 'lib/mutant/runner/config.rb', line 89 def amount_kills mutations.select(&:success?).length end |
#amount_mutations ⇒ Fixnum
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 amount of mutations
111 112 113 |
# File 'lib/mutant/runner/config.rb', line 111 def amount_mutations mutations.length end |
#coverage ⇒ Float
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
77 78 79 80 |
# File 'lib/mutant/runner/config.rb', line 77 def coverage return 0.0 if amount_mutations.zero? && amount_kills.zero? (amount_kills.to_f / amount_mutations) * 100 end |
#failed_subjects ⇒ Enumerable<Subject>
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 failed subjects
41 42 43 |
# File 'lib/mutant/runner/config.rb', line 41 def failed_subjects subjects.reject(&:success?) end |
#mutations ⇒ Array<Mutation>
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 mutations
100 101 102 |
# File 'lib/mutant/runner/config.rb', line 100 def mutations subjects.map(&:mutations).flatten end |
#strategy ⇒ Strategy
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 strategy
67 68 69 |
# File 'lib/mutant/runner/config.rb', line 67 def strategy config.strategy end |
#success? ⇒ true, false
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.
Test if run was successful
56 57 58 |
# File 'lib/mutant/runner/config.rb', line 56 def success? coverage.round(COVERAGE_PRECISION) == config.expected_coverage.round(COVERAGE_PRECISION) end |