lib/mutant/reporter/cli/printer/mutation_result.rb in mutant-0.8.22 vs lib/mutant/reporter/cli/printer/mutation_result.rb in mutant-0.8.23
- old
+ new
@@ -7,11 +7,11 @@
# Reporter for mutation results
#
# :reek:TooManyConstants
class MutationResult < self
- delegate :mutation, :test_result
+ delegate :mutation, :isolation_result
MAP = {
Mutant::Mutation::Evil => :evil_details,
Mutant::Mutation::Neutral => :neutral_details,
Mutant::Mutation::Noop => :noop_details
@@ -23,11 +23,10 @@
Your tests do not pass initially or you found a bug in mutant / unparser.
Subject AST:
%s
Unparsed Source:
%s
- Test Result:
MESSAGE
NO_DIFF_MESSAGE = <<~'MESSAGE'
--- Internal failure ---
BUG: A generted mutation did not result in exactly one diff hunk!
@@ -45,11 +44,10 @@
NOOP_MESSAGE = <<~'MESSAGE'
---- Noop failure -----
No code was inserted. And the test did NOT PASS.
This is typically a problem of your specs not passing unmutated.
- Test Result:
MESSAGE
FOOTER = '-----------------------'
# Run report printer
@@ -66,10 +64,12 @@
# Print mutation details
#
# @return [undefined]
def print_details
__send__(MAP.fetch(mutation.class))
+
+ visit_isolation_result unless isolation_result.success?
end
# Evil mutation details
#
# @return [String]
@@ -99,25 +99,23 @@
# Noop details
#
# @return [String]
def noop_details
info(NOOP_MESSAGE)
- visit_test_result
end
# Neutral details
#
# @return [String]
def neutral_details
info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source)
- visit_test_result
end
# Visit failed test results
#
# @return [undefined]
- def visit_test_result
- visit(TestResult, test_result)
+ def visit_isolation_result
+ visit(IsolationResult, isolation_result)
end
# Original node
#
# @return [Parser::AST::Node]