-
Notifications
You must be signed in to change notification settings - Fork 30
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
Using the "And debugger" step twice in a Cucumber scenario prints a wall of warnings #80
Comments
I looked into this and found which part of the code causes the warnings when triggered more than once. I also found several ways in which this can be fixed but every one has its own drawbacks.
I don't think its good to swallow all warnings because in future ruby versions there may be new warnings we want to know of so we can take action. 2.) Checking if IRB is already set up by checking if one of the constants the warnings complain about is already loaded:
This could be prone to errors because class names may differ between different versions of ruby and then its not working. 3.) Check if we ran the code before and if yes omit it:
The only drawback here is that it only fixes the error if the step is called more than once in one scenario. If it is called in two or more different scenarios in the same run it will again lead to the wall of warnings. For me using debugger in multiple scenarios in the same run is an edge case - I usually only debug one scenario at a time and once this works I go on to the next one. Therefore this seems to be the best solution to me although it does not cover every way the warnings can be triggered. Any opinions on this? Or maybe other ideas to solve this? |
Thanks for investigating and preparing solutions.
The best solution would be to simply ask IRB whether it is setup, but a quick search brought no results on how to achieve this. |
Voting for option 2 if we can find a better way to determine if it is already set up. I agree with @judithroth that looking at the constant currently being defined twice is not that bullet-proof. Can we maybe find something that is defined during Works for me ™ on versions 0.9.5 (April 2013) and 1.0.0 (December 2018). |
Fixed with Version 1.12.3 |
Awesome, thanks! |
The second (or any further) invocation of the
debugger
step print these warnings:I assume this is caused by how
IRB
is required/initialized inside the step.Expected behavior
No wall of warnings.
The text was updated successfully, but these errors were encountered: