How do I globally configure RSpec to keep the '--color' and '--format specdoc' options turned on

Evolve picture Evolve · Nov 30, 2009 · Viewed 56k times · Source

How do I set global configuration for RSpec in Ubuntu.

Specifically so, --color and --format specdoc stay turned on, across all my projects (ie every time I run rspec anywhere).

Answer

abyx picture abyx · Nov 28, 2011

As you can see in the docs here, the intended use is creating ~/.rspec and in it putting your options, such as --color.

To quickly create an ~/.rspec file with the --color option, just run:

echo '--color' >> ~/.rspec