This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Description
I'm running rspec manually (without the rspec command), and I want to set the color configuration to true.
I've tried:
RSpec.configure do |c|
c.tty = true
c.color = true
end
p RSpec.configuration.tty? # => true
p RSpec.configuration.color? # => false
And as you can see that doesn't work.
Looking at the output_to_tty? method:
def output_to_tty?
begin
output_stream.tty? || tty?
rescue NoMethodError
false
end
end
I'm guessing that it's throwing NoMethodError on output_stream.tty? and returning false - therefore, color can't be enabled, since the color option depends on this method returning true.
So how can I (with code), force the color configuration to true?