Colorful RSpec Stories

I do not know why there are no colors in the stories, but here is a small monkeypatch to fix this… (setting option[color] and not overwriting them would be better, but i could not find where to set them…)

#vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb line ~50
@options.colour = true#HACK
out = "#@count scenarios: #@successful_scenario_count succeeded, #{@failed_scenarios.size} failed, #@pending_scenario_count pending"
if @failed_scenarios.size > 0
  out = red(out)
  if @pending_scenario_count > 0
    out = yellow(out)
    out = green(out)
@output.puts out 
#@output.puts "#@count scenarios: #@successful_scenario_count succeeded, #{@failed_scenarios.size} failed, #@pending_scenario_count pending"

Enjoy the colors 😀

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s