module Cucumber::Formatter::ANSIColor
Defines aliases for coloured output. You don't invoke any methods from
this module directly, but you can change the output colours by defining a
CUCUMBER_COLORS
variable in your shell, very much like how you
can tweak the familiar POSIX command ls
with <a href=“$LSCOLORS/$LS_COLORSmipsisrisc.com/rambling/2008/06/27/lscolorsls_colors-now-with-linux-support/”>$LSCOLORS/$LS_COLORS>
The colours that you can change are:
-
undefined
- defaults toyellow
-
pending
- defaults toyellow
-
pending_param
- defaults toyellow,bold
-
failed
- defaults tored
-
failed_param
- defaults tored,bold
-
passed
- defaults togreen
-
passed_param
- defaults togreen,bold
-
outline
- defaults tocyan
-
outline_param
- defaults tocyan,bold
-
skipped
- defaults tocyan
-
skipped_param
- defaults tocyan,bold
-
comment
- defaults togrey
-
tag
- defaults tocyan
For instance, if your shell has a black background and a green font (like the “Homebrew” settings for OS X' Terminal.app), you may want to override passed steps to be white instead of green.
Although not listed, you can also use grey
.
Examples: (On Windows, use SET instead of export.)
export CUCUMBER_COLORS="passed=white" export CUCUMBER_COLORS="passed=white,bold:passed_param=white,bold,underline"
To see what colours and effects are available, just run this in your shell:
ruby -e "require 'rubygems'; require 'term/ansicolor'; puts Cucumber::Term::ANSIColor.attributes"
Constants
- ALIASES
Public Instance Methods
# File lib/cucumber/formatter/ansicolor.rb, line 151 def cukes(n) ("(::) " * n).strip end
# File lib/cucumber/formatter/ansicolor.rb, line 155 def green_cukes(n) blink(green(cukes(n))) end
# File lib/cucumber/formatter/ansicolor.rb, line 159 def red_cukes(n) blink(red(cukes(n))) end
# File lib/cucumber/formatter/ansicolor.rb, line 163 def yellow_cukes(n) blink(yellow(cukes(n))) end