Skip to content

Allow options files and SPEC_OPTS to append to formatters options.

Created by: bobbytables

Hi! I'm realizing that when using the CLI to do something like so:

$ rspec -f progress -O custom.rspec spec/

And custom.rspec has:

--format RSpecJunitFormatter --out 'tmp/rspec-results/<%= SecureRandom.hex(10) %>'

It actually will not append multiple formatters to the RSpec configuration. I find this odd because it's very possible to add multiple from the CLI doing -f progress -f documentation --out docformat.txt

I found a spec that asserts that this behavior I'm describing is true, however it looks very old (several years): https://github.com/rspec/rspec-core/blob/master/spec/rspec/core/configuration_options_spec.rb#L474-L478

Is there a reason to maintain this behavior? Why always prefer CLI instead of merging both options like the others?

Merge request reports