Module | Protest::Utils::ColorfulOutput |
In: |
lib/protest/utils/colorful_output.rb
|
Mixin that provides colorful output to your console based reports. This uses bash‘s escape sequences, so it won‘t work on windows.
TODO: Make this work on windows with ansicolor or whatever the gem is named
colorize | [RW] | Whether to use colors in the output or not. The default is true. |
Returns a hash with the color values for different states. Override this method safely to change the output colors. The defaults are:
:passed: | Light green |
:pending: | Light yellow |
:errored: | Light purple |
:failed: | Light red |
See www.hypexr.org/bash_tutorial.php#colors for a description of Bash color codes.
Print the string to whatever IO stream is defined in the method stream using the correct color depending on the state passed.