Class: Mutant::Reporter::CLI::Printer::SubjectResult Private

Inherits:
Mutant::Reporter::CLI::Printer show all
Defined in:
lib/mutant/reporter/cli/printer/subject_result.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Subject result printer

Renders subject identification, tests, and all uncovered mutations inline so that subject context (source, node) is available when printing mutation details.

API:

  • private

Constant Summary collapse

MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

{
  'evil'    => :evil_details,
  'neutral' => :neutral_details,
  'noop'    => :noop_details
}.freeze
NEUTRAL_MESSAGE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

"--- Neutral failure ---\nOriginal code was inserted unmutated. And the test did NOT PASS.\nYour tests do not pass initially or you found a bug in mutant / unparser.\nSubject AST:\n%s\nUnparsed Source:\n%s\n"
NO_DIFF_MESSAGE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

"--- Internal failure ---\nBUG: A generated mutation did not result in exactly one diff hunk!\nThis is an invariant violation by the mutation generation engine.\nPlease report a reproduction to https://github.com/mbj/mutant\nOriginal unparsed source:\n%s\nOriginal AST:\n%s\nMutated unparsed source:\n%s\nMutated AST:\n%s\n"
NOOP_MESSAGE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

"---- Noop failure -----\nNo code was inserted. And the test did NOT PASS.\nThis is typically a problem of your specs not passing unmutated.\n"
SEPARATOR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

'-----------------------'
STATS_FORMAT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

'tests: %d, runtime: %.2fs, killtime: %.2fs'

Constants inherited from Mutant::Reporter::CLI::Printer

NL

Instance Method Summary collapse

Methods inherited from Mutant::Reporter::CLI::Printer

call, #call

Methods included from Procto

included

Instance Method Details

#runundefined

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.

Run report printer

Returns:

API:

  • private



61
62
63
64
65
66
67
68
# File 'lib/mutant/reporter/cli/printer/subject_result.rb', line 61

def run
  status(object.identification)
  puts(STATS_FORMAT % [tests.length, object.runtime, object.killtime])
  uncovered_results.each do |coverage_result|
    print_mutation_result(coverage_result.mutation_result)
  end
  print_selected_tests
end