-
-
Notifications
You must be signed in to change notification settings - Fork 690
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-expressions: Matching a literal open-parenthesis #333
Comments
Ah, sorry I missed that ticket! I promise I did try to do my due-diligence before posting. :) PR is incoming, look for it in a few. Thanks! |
6 tasks
Closed by 3c38076 |
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Summary
I'm using cucumber as a platform-agnostic way to describe an API in a book I'm writing, which is perhaps a bit out-of-the-ordinary for cucumber, but so far has worked great. Upgrading to 3.x has proven awkward, though, as many of my steps involve describing function calls, with parameters lists enclosed in parentheses, like so:
While I can represent this with a raw regex, the cucumber expressions are beautifully convenient. Sadly, given a step definition like this:
The parentheses are being interpreted as optional groups. Is there already a way to escape those, so they can be interpreted literally?
Expected Behavior
I would expect there to be a way to escape parentheses in cucumber expressions, so that they can be interpreted literally.
Current Behavior
There does not currently appear to be a way to escape parentheses in cucumber expressions.
Possible Solution
Consider
OPTIONAL_REGEXP
, here:https://github.com/cucumber/cucumber/blob/fc5308ff70378277cfbe6a56d102c5a8c42be69f/cucumber-expressions/ruby/lib/cucumber/cucumber_expressions/cucumber_expression.rb#L11
If this were made a bit more sophisticated, it could be made to ignore parentheses that are prefixed by an escape character (a backslash comes to mind, but maybe there's something else that is more idiomatic to Cucumber?)
Your Environment
The text was updated successfully, but these errors were encountered: