--tty vs. --color

Greetings,

What is the difference between rspec --tty and rspec --color. I just
noticed that under JRuby output for --color is not colored but for –
tty it is. Seems like we only need one color option, why two?

John-Mason P. Shackelford

On Jan 26, 2011, at 3:03 PM, John-Mason P. Shackelford wrote:

Greetings,

What is the difference between rspec --tty and rspec --color. I just
noticed that under JRuby output for --color is not colored but for –
tty it is. Seems like we only need one color option, why two?

The --tty option is there to tell RSpec that the output is being
streamed to a terminal as opposed to a file, in which case we don’t want
to print the color codes even if --color is invoked.

–tty by itself does not invoke colorization - there’s got to be --color
set somewhere: any of:

./.rspec
~/.rspec
ENV[“SPEC_OPTS”]
RSpec.configure …