Class: Mutant::Runner::Sink::Mutation
- Inherits:
-
Mutant::Runner::Sink
- Object
- Mutant::Runner::Sink
- Mutant::Runner::Sink::Mutation
- Defined in:
- lib/mutant/runner/sink.rb
Overview
Mutation result sink
Instance Method Summary collapse
-
#initialize ⇒ undefined
constructor
private
Initialize object.
-
#result(mutation_result) ⇒ self
private
Handle mutation finish.
-
#status ⇒ Status
private
Runner status.
-
#stop? ⇒ Boolean
private
Test if scheduling stopped.
Constructor Details
#initialize ⇒ 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.
Initialize object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mutant/runner/sink.rb', line 39 def initialize(*) super @start = Time.now @subject_results = Hash.new do |_hash, subject| Result::Subject.new( subject: subject, tests: [], mutation_results: [] ) end end |
Instance Method Details
#result(mutation_result) ⇒ self
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.
Handle mutation finish
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/mutant/runner/sink.rb', line 76 def result(mutation_result) mutation = mutation_result.mutation original = @subject_results[mutation.subject] @subject_results[mutation.subject] = original.with( mutation_results: (original.mutation_results + [mutation_result]), tests: mutation_result.test_result.tests ) self end |
#status ⇒ Status
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.
Runner status
56 57 58 |
# File 'lib/mutant/runner/sink.rb', line 56 def status env_result end |
#stop? ⇒ Boolean
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 scheduling stopped
65 66 67 |
# File 'lib/mutant/runner/sink.rb', line 65 def stop? env.config.fail_fast && !env_result.subject_results.all?(&:success?) end |