diff --git a/lib/mutant/reporter/cli/printer/mutation_result.rb b/lib/mutant/reporter/cli/printer/mutation_result.rb index f21643c7..f8e9f2a1 100644 --- a/lib/mutant/reporter/cli/printer/mutation_result.rb +++ b/lib/mutant/reporter/cli/printer/mutation_result.rb @@ -25,7 +25,6 @@ module Mutant %s Unparsed Source: %s - Test Result: MESSAGE NO_DIFF_MESSAGE = <<~'MESSAGE' @@ -47,7 +46,6 @@ module Mutant ---- 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 = '-----------------------' @@ -68,6 +66,8 @@ module Mutant # @return [undefined] def print_details __send__(MAP.fetch(mutation.class)) + + visit_isolation_result unless isolation_result.success? end # Evil mutation details @@ -101,7 +101,6 @@ module Mutant # @return [String] def noop_details info(NOOP_MESSAGE) - visit_isolation_result end # Neutral details @@ -109,7 +108,6 @@ module Mutant # @return [String] def neutral_details info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source) - visit_isolation_result end # Visit failed test results diff --git a/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb b/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb index 118fca7a..7403fb6a 100644 --- a/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb +++ b/spec/unit/mutant/reporter/cli/printer/mutation_result_spec.rb @@ -6,7 +6,27 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do let(:reportable) { mutation_a_result } describe '.call' do - context 'failed kill' do + context 'isolation problem' do + let(:status) do + instance_double(Process::Status) + end + + let(:mutation_a_isolation_result) do + Mutant::Isolation::Fork::ChildError.new(status) + end + + it_reports(<<~'REPORT') + evil:subject-a:d27d2 + @@ -1,2 +1,2 @@ + -true + +false + Killfork exited nonzero. Its result (if any) was ignored: + # + ----------------------- + REPORT + end + + context 'unsucessful result' do with(:mutation_a_test_result) { { passed: true } } context 'on evil mutation' do @@ -80,11 +100,6 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do s(:true) Unparsed Source: true - Test Result: - - 1 @ runtime: 1.0 - - test-a - Test Output: - mutation a test result output ----------------------- REPORT end @@ -101,11 +116,6 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do ---- 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: - - 1 @ runtime: 1.0 - - test-a - Test Output: - mutation a test result output ----------------------- REPORT end