Skip to content
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

Clashes with capybara inside of cucumber on the all method #927

Open
PragTob opened this issue Apr 16, 2024 · 5 comments
Open

Clashes with capybara inside of cucumber on the all method #927

PragTob opened this issue Apr 16, 2024 · 5 comments
Assignees

Comments

@PragTob
Copy link

PragTob commented Apr 16, 2024

👓 What did you see?

Basically while trying to upgrade gems the all method from rspec-expectations in aruba clashes with capybara's definition of all and hence the tests and upgrade fail. I've created a small reproduction repo here: https://github.com/PragTob/all_conflict

✅ What did you expect to see?

I'd wish to be able to use aruba and capybara in the same project, although I acknowledge it's a minority use case

📦 Which tool/library version are you using?

Check the Gemfile.lock from the repro repo: https://github.com/PragTob/all_conflict/blob/main/Gemfile.lock

Should all be most recent

🔬 How could we reproduce it?

Check the repro repo :) https://github.com/PragTob/all_conflict/

📚 Any additional context?

Thanks for all your work! :green

Cross reference, capybare issue: teamcapybara/capybara#2761

@mvz
Copy link
Contributor

mvz commented May 1, 2024

@PragTob just to summarize, the problem is that aruba requires rspec-expectations, and that causes problems in the simplecov test suite because that test suite also requires capybara, and capybara's all conflicts with rspec-expectations' all?

@mvz
Copy link
Contributor

mvz commented May 1, 2024

@PragTob looking at your original upgrading pull request (simplecov-ruby/simplecov#1088), it looks like both rspec-expectations and capybara were already present and apparently not conflicting before the upgrade. So this used to actually work.

@mvz mvz self-assigned this May 1, 2024
@PragTob
Copy link
Author

PragTob commented May 1, 2024

@mvz yea it used to work, it seems there is a workaround at capybara as detailed: teamcapybara/capybara#2761 - but out of the box it still breaks (see the reproduction repo) but the maintainer there was unresponsive. I wanted to get back to it and see if I can get their workaround to work there as well. My assumption right now is there is a workaround, but capybara doesn't load it when in the cucumber environment (as it does not expect rspec-expectations inside of cucumber).

Any way, looks like the fix then is most likely over at capybara (as there already is a workaround from them) and so likely nothing to do over here :)

I'd keep it open until it's really figured out though.

@PragTob
Copy link
Author

PragTob commented Jun 22, 2024

I revisited it and found a manual workaround, I'm hoping to get capybara to fixing the proxy again but not sure teamcapybara/capybara#2761 (comment)

@luke-hill
Copy link
Contributor

luke-hill commented Jul 16, 2024

There's a simple shim you can use to avoid this conflict by including Capybara::RSpecMatcherProxies into the Cucumber world.

Requiring it manually isn't enough you need to add it to the Worldable modules @PragTob by doing World(Capybara::RSpecMatcherProxies) or a comma separated list if you have more

cf: https://github.com/teamcapybara/capybara/blob/master/lib/capybara/rspec/matcher_proxies.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants