Skip to content

Auto-generated step definitions should escape dollar signs / other regex chars #204

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

Closed
undees opened this issue Feb 15, 2012 · 3 comments
Closed

Comments

@undees
Copy link
Contributor

undees commented Feb 15, 2012

From the following line in a scenario:

Given I have $5 in my account

Cucumber-JVM generated the following step definition:

@Given("^I have $(\\d+) in my account$")
public void I_have_$_in_my_account(int arg1) {
// Express the Regexp above with the code you wish you had
}

The regex doesn't match my feature until I manually escape the dollar sign, like so:

@Given("^I have \\$(\\d+) in my account$")
@aslakhellesoy
Copy link
Contributor

Have a look at JavaSnippet and JavaSnippetTest if you want to fix this.

@undees
Copy link
Contributor Author

undees commented Feb 19, 2012

Thanks for getting me pointed in the right direction; I've submitted pull request #215.

@lock
Copy link

lock bot commented Oct 25, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants