Hey,
After upgrading from 3.5.0.beta3 to 3.5.0.beta4 I receive a warning when using the rails console command like:
bundle exec rails console
Loading development environment (Rails 5.0.0.rc2)
irb: warn: can't alias context from irb_context.
irb(main):001:0>
Version beta3 works well, the warning is only visible in beta4.
That did not help - i know
That warning is coming from IRB here:
It's apparently happening because rspec-core, when loaded, defines context on the top level unless you disable monkey patching.
Can you provide a repo that repros this? I tried reproing it in isolation and have failed so far.
@myronmarston ah thanks, I'll try to create a repro the next days. Do you mean this line config.disable_monkey_patching! in spec_helper.rb? It seems monkeypatching is disabled in both of my scenarios, but only with rspec-rails-3.5.0.beta4 the warning gets printed.
Do you mean this line
config.disable_monkey_patching!inspec_helper.rb? It seems monkeypatching is disabled in both of my scenarios, but only with rspec-rails-3.5.0.beta4 the warning gets printed.
Correct, that's what I meant, but I just realized why that doesn't solve the problem here: because you have to opt-in to disabling monkey patching (instead of opting in to monkey patching), the monkey patches, including context being defined on main still happen up-front, and then the config option disables them. So it still triggers the IRB warning.
hey @marcusg could you provide us with a reproduction case for this issue? Just a repository we can clone that demonstrates the problem. With that we can debug :)
@samphippen yes, of course. I'll add repro steps as soon as possible.
I've created a repro app https://github.com/marcusg/rspec-rails-issue-1645
Repro confirmed.
I've got the same warning after upgrading rspec-rails to 3.5.1
There's an attempted fix in #1678 -- can one of you who has ran into this issue give that a try?
Can you merge this into the 3-5 branch as well?
Sent from my iPhone
On Jul 22, 2016, at 7:01 PM, Jon Rowe [email protected] wrote:
Closed #1645 via #1678.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Done.
Works for me with 3-5-maintenance branch, thank you guys!
I'm still having issues with:
$ rails c
Loading development environment (Rails 4.2.8)
irb: warn: can't alias context from irb_context.
2.3.1 :001 > exit
[EDIT] Just learned many other gems could cause this — I will investigate this further.
Most helpful comment
I'm still having issues with:
[EDIT] Just learned many other gems could cause this — I will investigate this further.