Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
undees opened this Issue Feb 15, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Member

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$")
Owner

aslakhellesoy commented Feb 16, 2012

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

Member

undees commented Feb 19, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment