-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clash on all
method with aruba/rspec-expectations in cucumber
#2761
Comments
This happened years ago when especially added their ‘all’ method and were unwilling to work on a solution. If RSpec is shadowing Capybara you can use the ‘find_all’ alias in Capybara. Otherwise Capybara,, iassuming its included correctly, installs proxies which should be calling the correct version of ‘all’ based on passed parameter types - https://github.com/teamcapybara/capybara/blob/master/lib/capybara/rspec/matcher_proxies.rb |
@twalpole hey, thank you but have you seen the reproduction repo - it's a minimized example of just a few lines and it's definitely happening. It shows how the source of the method changes and the test starts failing once capybara is required along with a warning that it will also raise in future versions of capybara. I'm not sure why the matcher_proxies aren't there - it might be because the tests I'm running are in cucumber and I'm requiring |
Hey @twalpole / whoever, as outlined above I continue to believe this is an actual problem as shown in the minimized example. I've found a workaround via some debugging: PragTob/all_conflict#1
I'm also reasonably sure capybara is included correctly there (as you can see in the diff above). It just seems that the work around for install the proxy is too specific and doesn't cover the use case that comes up with aruba - hence including it manually in the relevant module fixes it. I'm not too familiar with the code there and hence couldn't come out with a good fix (as I also don't know why some of the protections are in place). I seem to have half-way successfully included this workaround in simplecov, but would really appreciate a more general solution. simplecov-ruby/simplecov#1088 |
Because that's how Cucumber world module mixes-in Capybara::DSL https://github.com/cucumber/cucumber-ruby/blob/v9.2.0/lib/cucumber/glue/proto_world.rb#L176 fixes teamcapybara#2761
Heyo, thanks for all your work on capybara!
Meta
capybara (3.40.0)
Ruby 3.3
Issue & reproduction
I have documented and reproduced the issue in this repo: https://github.com/PragTob/all_conflict
Most basically the capybara DSL method
all
clashes withall
ofrspec-expectations
whicharuba
uses. This conflict must have come in some version update and so I'm unable to upgrade gem versions in simplecov.I'm not sure about the best solution. I couldn't find it in the docs, but if one could use capybara with the DSL not being global but bound to a
page
as it is in some setups (but seemingly not with cucumber) that should solve the issue.Thanks a lot for all your work! 💚
Cross reference aruba issue: cucumber/aruba#927
The text was updated successfully, but these errors were encountered: