Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Comments

Add require: false to Gemfile example#123

Open
r7kamura wants to merge 1 commit intoNoRedInk:masterfrom
r7kamura:feature/require-false
Open

Add require: false to Gemfile example#123
r7kamura wants to merge 1 commit intoNoRedInk:masterfrom
r7kamura:feature/require-false

Conversation

@r7kamura
Copy link

If you run require 'rspec/core' before the appropriate timing, Kernel.#context would be defined unexpectedly and you will get a warning when you load irb. The following Issue provides more information on this issue.

This Gem executes require 'rspec/core' when loaded, so if it is loaded in a Rails app with Bundler.require it will cause this problem. This pull request solves this problem.

require 'rspec/core'

$ bin/rails c -e test
Loading test environment (Rails 7.0.4)
irb: warn: can't alias context from irb_context.
irb(main):001:0> exit

Since the README already explains to write require 'rspec/retry', there is no problem to explain to add require: false like this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant