Color Rspec Output for All Projects

Ran into an issue today where I wanted rspec to use color output regardless of whether or not the project had it set up in the .rspec or spec_helper.rb files.

A super simple way to do this is to update your .bash_profile and override the rspec command with the colour switch:

vi ~/.bash_profile

Add the following to .bash_profile and save:

alias rspec='rspec --colour'

Reload the file:

source ~/.bash_profile

And you should be all set! Just run rspec as you normally would and the colour switch will be added automatically via the alias.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: