RSpec has the ability to automatically load custom formatter that follows the naming conventions properly, so there is no need to have Bundler.require load it for you.
Adding this require: false makes it more profitable to have it loaded only when needed (e.g. only in CI if you use this formatter only in CI).
I don't think many people want to output JUnit format files locally, so it will cut down on unnecessary loading in many cases. Also, this README Gemfile example is probably close to the example used in a typical Rails app, so many Rails users will benefit from this.
This change also eliminates another problem. If you run require 'rspec/core' before the appropriate time, Kernel.#context will be defined and you will get a warning when you load irb. The following Issue provides more information on this issue.
Since rspec_junit_formatter executes require 'rspec/core' when loaded, it causes this problem when loaded with Bundler.require. This require: false also resolves this problem.
RSpec has the ability to automatically load custom formatter that follows the naming conventions properly, so there is no need to have
Bundler.require
load it for you.Adding this
require: false
makes it more profitable to have it loaded only when needed (e.g. only in CI if you use this formatter only in CI).I don't think many people want to output JUnit format files locally, so it will cut down on unnecessary loading in many cases. Also, this README Gemfile example is probably close to the example used in a typical Rails app, so many Rails users will benefit from this.
This change also eliminates another problem. If you run
require 'rspec/core'
before the appropriate time,Kernel.#context
will be defined and you will get a warning when you load irb. The following Issue provides more information on this issue.Since rspec_junit_formatter executes
require 'rspec/core'
when loaded, it causes this problem when loaded withBundler.require
. Thisrequire: false
also resolves this problem.