Can I set rspec --format documentation as the default?

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.


Option 1

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

Option 2

Add it to RSpec.configure block:

RSpec.configure do |config|
  config.formatter = :documentation
end

Option 3

Specify rspec's options globally by adding them to ~/.rspec.


RSpec.configure do |config|
  config.color = true
  config.formatter = :documentation
  config.order = 'default'
end