Class: Mutant::Runner::Sink::Mutation

Inherits:
Mutant::Runner::Sink show all
Defined in:
lib/mutant/runner/sink.rb

Overview

Mutation result sink

Instance Method Summary collapse

Constructor Details

#initializeundefined

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

Parameters:

Returns:

  • (self)


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

#statusStatus

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

Returns:

  • (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

Returns:

  • (Boolean)


65
66
67
# File 'lib/mutant/runner/sink.rb', line 65

def stop?
  env.config.fail_fast && !env_result.subject_results.all?(&:success?)
end