Remove complexity in cli reporter

This commit is contained in:
Markus Schirp 2012-08-16 19:42:45 +02:00
parent 18af58c7e3
commit ba34d4d6de

View file

@ -36,11 +36,7 @@ module Mutant
# #
def killer(killer) def killer(killer)
if killer.fail? if killer.fail?
@io.puts(colorize(Color::RED, "!!! Uncovered Mutation !!!")) failure(killer)
differ = Differ.new(killer.original_source,killer.mutation_source)
diff = color? ? differ.colorized_diff : differ.diff
@io.puts(diff)
@io.puts
end end
self self
@ -60,6 +56,22 @@ module Mutant
@io = io @io = io
end 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 # Test for colored output
# #
# @return [true] # @return [true]