rspec/rspec-core

Requiring rspec before IRB console causes warning

wildmaples opened this issue · 1 comments

Subject of the issue

Just a question but when we require this gem and use irb, we see this warning:

DEPRECATION WARNING: irb: warn: can't alias context from irb_context.

We realized it's because context is being added at the top level here: https://github.com/rspec/rspec-core/blob/main/lib/rspec/core/dsl.rb#L84

Your environment

  • Ruby version: 3.2.2
  • rspec-core version: 3.12.2

Steps to reproduce

  • Require rspec right before booting rails console

Expected behavior

There isn't really a problem with this behaviour but just curious to know if it is needed as context used in a describe block.

Actual behavior

If you turn off monkey patching with https://rspec.info/documentation/3.13/rspec-core/RSpec/Core/Configuration.html#disable_monkey_patching!-instance_method this should go away

(closing as duplicate of #2776)