-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cucumber is generating Ruby step definition snippets that cause Ruby warnings. #328
Comments
So two options here:
I care. I think I like option 1 best. What do other people think? |
Oh wait that's three options. :) |
I like
|
but actually, now that I consider it further, i think the
It seems more legible and should still address the issue. |
Are those two examples the same? Are the anchors not required with the |
They're not the same. I tested earlier and was going to mention that. I tried using |
To better answer your question, I didn't use the anchors when testing. So right now that would lead me to believe that they are necessary. |
@mattwynne i opened a pull request here |
Thanks! |
Fixed by PR #331 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Steps to Recreate
If I save a file called
addition.feature
that has the following line inside of it:And at the command line I run:
Cucumber will tell me that I haven’t implemented the step defintion, and it provides me with a snippet to move me along.
This is really useful
However, when I check the ruby syntax of
features/addition.feature
with warnings on:I get the following warning:
And whenever I save a file that has many Cucumber-generated snippets inside of it, I see this in my vim Quickfix window (which is checking syntax with warnings on):
This is alarming
Who Cares
One response to this might be, “Who cares? Not my problem, if you don’t want to see the warnings, turn off verbose mode. Verbose mode is broken.”
I might agree with that while writing closed-source stuff, but I disagree when considering open source software. As @mislav writes (emphasis mine):
Addressing the Issue
The ruby warning is happening because the first
/
of the Cucumber-generated snippet could signify either a division or a regular expression. I’ve tested a fix that wraps the regular expression in parentheses and the warning is gone. This could happen in-line or perhaps could be activated by a setting. I’ve got a pull request lined-up, but wanted to check here first for initial feedback or thoughts.Thanks. I think the snippet-generation is really useful, and I would love to continue using it with, at the very least, an option to generate ruby-safe snippets.
The text was updated successfully, but these errors were encountered: