Class: Mutant::Runner::Subject

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

Overview

Subject specific runner

Constant Summary

Constants inherited from Mutant::Runner

REGISTRY

Instance Attribute Summary collapse

Attributes inherited from Mutant::Runner

#config

Instance Method Summary collapse

Methods inherited from Mutant::Runner

run, #running?, #runtime, #stop?

Constructor Details

#initialize(config, subject) ⇒ 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

Parameters:



28
29
30
31
# File 'lib/mutant/runner/subject.rb', line 28

def initialize(config, subject)
  @subject = subject
  super(config)
end

Instance Attribute Details

#mutationsEnumerable<Runner::Mutation> (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 mutation runners

Returns:



39
40
41
# File 'lib/mutant/runner/subject.rb', line 39

def mutations
  @mutations
end

#subjectSubject (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

Returns:



15
16
17
# File 'lib/mutant/runner/subject.rb', line 15

def subject
  @subject
end

Instance Method Details

#failed_mutationsEnumerable<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 failed mutations

Returns:



47
48
49
# File 'lib/mutant/runner/subject.rb', line 47

def failed_mutations
  mutations.reject(&:success?)
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 subject was processed successful

Returns:

  • (true)

    if successful

  • (false)

    otherwise



62
63
64
# File 'lib/mutant/runner/subject.rb', line 62

def success?
  failed_mutations.empty?
end

#testsEnumerable<Test>

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 tests used to kill mutations on this subject

Returns:

  • (Enumerable<Test>)


72
73
74
# File 'lib/mutant/runner/subject.rb', line 72

def tests
  config.strategy.tests(subject)
end