[rspec-users] --tty vs. --color

128 views
Skip to first unread message

John-Mason P. Shackelford

unread,
Jan 26, 2011, 4:03:50 PM1/26/11
to rspec...@rubyforge.org
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
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

David Chelimsky

unread,
Jan 26, 2011, 4:16:46 PM1/26/11
to rspec-users

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 ...

Reply all
Reply to author
Forward
0 new messages