Forced color output #326

Closed
Shamaoke opened this Issue Feb 24, 2011 · 2 comments

Comments

Projects
None yet
2 participants

Hi.

In versions of RSpec before 2.0 it was possible to pipe the color output to pagers or redirect it to a file. There's the RSPEC_COLOR environment variable for that purpose. However, now the usage of that variable is unsupported, the color tags is stripped in the mentioned conditions and the output in the Less or More pagers becomes monochrome. Also, there are no color tags in the output file.

I would like to have an ability to color the piped or redirected output. It can be realised by adding the --force-color option for example or may be better to not allow the present --color option to strip the color tags.

Thanks.

I tackled with the question.

In the RSpec versions after and including 2.0 it's configured through RSpec::Core::Configuration#tty= method.

RSpec.configure { |c| c.tty = true }

Option --tty will do it. Put it in ~/.rspec if you want it globally.

@JonRowe JonRowe locked and limited conversation to collaborators Mar 29, 2015

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.