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.

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.

{
  '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.

<<~'MESSAGE'
  --- Neutral failure ---
  Original code was inserted unmutated. And the test did NOT PASS.
  Your tests do not pass initially or you found a bug in mutant / unparser.
  Subject AST:
  %s
  Unparsed Source:
  %s
MESSAGE
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.

<<~'MESSAGE'
  --- Internal failure ---
  BUG: A generated mutation did not result in exactly one diff hunk!
  This is an invariant violation by the mutation generation engine.
  Please report a reproduction to https://github.com/mbj/mutant
  Original unparsed source:
  %s
  Original AST:
  %s
  Mutated unparsed source:
  %s
  Mutated AST:
  %s
MESSAGE
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.

<<~'MESSAGE'
  ---- Noop failure -----
  No code was inserted. And the test did NOT PASS.
  This is typically a problem of your specs not passing unmutated.
MESSAGE
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.

'-----------------------'
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.

'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:

  • (undefined)


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