How can I turn off (disable, negate) an rspec command line option?

110 views Asked by At

In my team's Rails app, our file .rspec includes --profile.

I don't want profile information showing up 99% of the times I run rspec locally. Changing .rspec for the whole team is not an option.

In my file .rspec-local (which is gitignored), I would like to suppress or override the setting in .rspec

Is this possible?

What is the syntax to do suppress an rspec parameter already declared?

1

There are 1 answers

1
David Hempy On

Prefix flag options with no- to override previous declarations. For example, .rspec gets loaded first, then .rspec-local gets loaded second:

.rspec:

--profile
--no-color

.rspec-local:

--no-profile
--color

The result is that rspec will run without the profile, and with color.

EDIT: TIL that you can create ~/.rspec in your home directory and it will be loaded for all your projects! Unfortunately, that doesn't work when your tests run inside a docker container.