Reputation: 1992
Per the Rspec documentation, by default when you run rspec
you get the progress formatter (looks like this: ".....").
There is another formatting option rspec --format documentation
that goes through each test one by one. My question: how can I enable --format documentation
by default without having to type it in the command line every time?
Upvotes: 18
Views: 8647
Reputation: 52367
Add it to .rspec
file (or create one in the project's root directory) - options added to it will be applied to every test run within current project:
# .rspec
--color
--format documentation
Add it to RSpec.configure
block:
RSpec.configure do |config|
config.formatter = :documentation
end
Specify rspec's options globally by adding them to ~/.rspec
.
Upvotes: 44
Reputation: 1992
RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.order = 'default'
end
Upvotes: 8
Reputation: 102250
You can create your own personal RSpec settings by creating a ~/.rspec
file:
--color
--format documentation
The project .rspec
file should only contain the minimum settings required to run the spec suite to avoid developer wars.
Upvotes: 5