Class: MutationTester::BatchRunner::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/mutation_tester/batch_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#interruptedObject

Returns the value of attribute interrupted

Returns:

  • (Object)

    the current value of interrupted



31
32
33
# File 'lib/mutation_tester/batch_runner.rb', line 31

def interrupted
  @interrupted
end

#processedObject

Returns the value of attribute processed

Returns:

  • (Object)

    the current value of processed



31
32
33
# File 'lib/mutation_tester/batch_runner.rb', line 31

def processed
  @processed
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



31
32
33
# File 'lib/mutation_tester/batch_runner.rb', line 31

def skipped
  @skipped
end

#unchangedObject

Returns the value of attribute unchanged

Returns:

  • (Object)

    the current value of unchanged



31
32
33
# File 'lib/mutation_tester/batch_runner.rb', line 31

def unchanged
  @unchanged
end

Instance Method Details

#interrupted?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/mutation_tester/batch_runner.rb', line 56

def interrupted?
  !!interrupted
end

#matched_any?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/mutation_tester/batch_runner.rb', line 52

def matched_any?
  !(processed.empty? && skipped.empty? && (unchanged || []).empty?)
end

#success?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/mutation_tester/batch_runner.rb', line 32

def success?
  processed.all?(&:passed?)
end

#survivorsObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/mutation_tester/batch_runner.rb', line 36

def survivors
  processed.flat_map do |entry|
    (entry.results || [])
      .select { |r| Reporters::BaseReporter.status_for(r) == :survived }
      .map do |r|
        {
          file: entry.source_file,
          line: r[:line],
          type: r[:type],
          original: r[:original],
          mutated: r[:mutated]
        }
      end
  end
end