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:



26
27
28
29
# File 'lib/mutant/runner/subject.rb', line 26

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:



37
38
39
# File 'lib/mutant/runner/subject.rb', line 37

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:



13
14
15
# File 'lib/mutant/runner/subject.rb', line 13

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:



45
46
47
# File 'lib/mutant/runner/subject.rb', line 45

def failed_mutations
  mutations.reject(&:success?)
end

#success?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 subject was processed successful

Returns:

  • (Boolean)


56
57
58
# File 'lib/mutant/runner/subject.rb', line 56

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>)


66
67
68
# File 'lib/mutant/runner/subject.rb', line 66

def tests
  config.tests(subject)
end