O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting Command-Line Defaults

We’ve brought these command-line options together in one chapter so that you can refer to them whenever you want to do something special for a single test run. Sometimes, though, you may need custom behavior for every run.

Rather than wasting time typing the same options over and over, you can save a set of arguments as command-line defaults. As the term implies, RSpec will use these by default for every run—but you can still override them.

To set defaults, save your desired options in a text file at any of the following three paths:

~/.rspec

Use this file in your home directory to store global personal preferences. RSpec will use it for any project on your machine. For instance, you may prefer to stop your test ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required