diff --git a/lib/mutant/reporter/cli.rb b/lib/mutant/reporter/cli.rb index 970d3f22..d99fe9d8 100644 --- a/lib/mutant/reporter/cli.rb +++ b/lib/mutant/reporter/cli.rb @@ -36,11 +36,7 @@ module Mutant # def killer(killer) if killer.fail? - @io.puts(colorize(Color::RED, "!!! Uncovered Mutation !!!")) - differ = Differ.new(killer.original_source,killer.mutation_source) - diff = color? ? differ.colorized_diff : differ.diff - @io.puts(diff) - @io.puts + failure(killer) end self @@ -60,6 +56,22 @@ module Mutant @io = io end + # Report failure on killer + # + # @param [Killer] killer + # + # @return [undefined] + # + # @api private + # + def failure(killer) + @io.puts(colorize(Color::RED, "!!! Uncovered Mutation !!!")) + differ = Differ.new(killer.original_source,killer.mutation_source) + diff = color? ? differ.colorized_diff : differ.diff + @io.puts(diff) + @io.puts + end + # Test for colored output # # @return [true]