-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
[bug] Nokogiri::CSS throws cryptic error messages when missing a parameter #2700
Comments
Hi, I'm sorry you're having a problem. I'll try to help. You skipped the bit in the issue template entitled "Help us reproduce what you're seeing." I spent about 15 minutes trying to reproduce this, and looking through the Capybara source code, and I can't. As a prompt, here's the section you skipped:
Can you also help me understand why you're reporting this here instead of with the Capybara project? |
Well the code does not really matter, it is about the shell interaction. This is also a bit of a legacy project which I am slowly trying to bring up to date, so I did not want to invest too much time upfront to investigate something that has already been fixed. |
Please put yourself in my spot: I don't use Capybara and don't know how to set up an isolated test case. What would you do with this issue? Thankfully after a few more minutes I have reproduced what you're seeing: Nokogiri::HTML5.parse("<div></div>").css("") I think you should also report this upstream at Capybara because it doesn't appear to be checking the number of arguments passed to those methods. Although Nokogiri could be raising a better exception here, Capybara could be a bit more defensive about how it calls Nokogiri. |
See #2701 for the fix which will be in Nokogiri 1.14.0 when it's released. |
thank you so much, I am rather new to the whole ruby on rails ecosystem and still struggling to grasp how everything interacts :) |
Please describe the bug
When calling a Nokogiri::CSS selector without a parameter, this message appears:
https://stackoverflow.com/questions/74457363/capybara-rspec-empty-html-nokogiricsssyntaxerror-unexpected-after?noredirect=1#comment131440070_74457363
Expected behavior
Tell the user a parameter is missing
Environment
The text was updated successfully, but these errors were encountered: