Sha256: 9c7f5a95e29e445047a1315d8da5cbcfc41efce0826a13e6abbc286b050abc7a

Contents?: true

Size: 965 Bytes

Versions: 1

Compression:

Stored size: 965 Bytes

Contents

# encoding: utf-8

module Mutant
  class Reporter
    class CLI
      class Printer

        # Printer for killer results
        class Killer < self

          handle(Mutant::Killer::Forked)

          SUCCESS = '.'.freeze
          FAILURE = 'F'.freeze

          # Run printer
          #
          # @return [undefined]
          #
          # @api private
          #
          def run
            if success?
              char(SUCCESS, Color::GREEN)
            else
              char(FAILURE, Color::RED)
            end
          end

        private

          # Write colorized char
          #
          # @param [String] char
          # @param [Color]
          #
          # @return [undefined]
          #
          # @api private
          #
          def char(char, color)
            output.write(colorize(color, char))
            output.flush
          end

        end # Killer
      end # Printer
    end # CLI
  end # Reporter
end # Mutant

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mutant-0.3.0.rc1 lib/mutant/reporter/cli/printer/killer.rb