Class: Mutant::Reporter::CLI::Printer::MutationResult

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

Overview

Reporter for mutation results

Constant Summary collapse

DIFF_ERROR_MESSAGE =
'BUG: Mutation NOT resulted in exactly one diff hunk. Please report a reproduction!'.freeze
MAP =
{
  Mutant::Mutation::Evil    => :evil_details,
  Mutant::Mutation::Neutral => :neutral_details,
  Mutant::Mutation::Noop    => :noop_details
}.freeze
NEUTRAL_MESSAGE =
"--- Neutral failure ---\n" \
"Original code was inserted unmutated. And the test did NOT PASS.\n" \
"Your tests do not pass initially or you found a bug in mutant / unparser.\n" \
"Subject AST:\n" \
"%s\n" \
"Unparsed Source:\n" \
"%s\n" \
"Test Result:\n".freeze
NO_DIFF_MESSAGE =
"--- Internal failure ---\n" \
"BUG: Mutation NOT resulted in exactly one diff hunk. Please report a reproduction!\n" \
"Original unparsed source:\n" \
"%s\n" \
"Original AST:\n" \
"%s\n" \
"Mutated unparsed source:\n" \
"%s\n" \
"Mutated AST:\n" \
"%s\n".freeze
NOOP_MESSAGE =
"---- Noop failure -----\n" \
"No code was inserted. And the test did NOT PASS.\n" \
"This is typically a problem of your specs not passing unmutated.\n" \
"Test Result:\n".freeze
'-----------------------'.freeze

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

NL

Instance Method Summary collapse

Methods included from Delegator

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)


54
55
56
57
58
# File 'lib/mutant/reporter/cli/printer/mutation_result.rb', line 54

def run
  puts(mutation.identification)
  print_details
  puts(FOOTER)
end