In other o/s RSpec returns nicely coloured results (red, green etc).
However in the windows (Vista) command prompt my text output is just plain old boring white.
How can I bring colour to my RSpec test results?
Thanks
Evolve
When using the MINGW64 bash shell provided by Git on Windows rspec displays things without any color. While this shell environment is perfectly capable of displaying ANSI color, rspec fails to detect it as a TTY. A super simple workaround is to use:
$ rspec --force-color
For example, take this boring old monochrome: :
And make it happy with one simple command line argument:
UPDATE: Win32Console no longer works with rspec. ANSICON recommended. https://github.com/rspec/rspec-rails/issues/487#issuecomment-3556806
I had to install ansicon, and now everything is fine. (Even in my Aptana terminal).
Install ansicon description: http://qastuffs.blogspot.com/2011/02/how-to-install-ansicon-for-cucumber-to.html
Did you specify '--color' in your rake rspec tasks' spec_opts? Something like this..
Spec::Rake::SpecTask.new(:your_task_name) do |t|
t.spec_opts = ["--color"]
t.spec_files = [] # List of spec files
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With