Skip to content

Instantly share code, notes, and snippets.

@danilo-barboza
Created April 27, 2012 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilo-barboza/2509895 to your computer and use it in GitHub Desktop.
Save danilo-barboza/2509895 to your computer and use it in GitHub Desktop.
Alias stepdef
@Given("^I have (\\d+) cukes in my belly$")
@Alias(values = { "^someone have (\\d+) cukes in my belly$", "^my belly contains (\\d+) cukes$" })
public void I_have_cukes_in_my_belly(int n) {
}
// OR
@Given(values = { "^I have (\\d+) cukes in my belly$", "^someone have (\\d+) cukes in my belly$" })
public void I_have_cukes_in_my_belly(int n) {
}
// It's possible to do that, but this ignored param is weird
@Given("^(I|someone) have (\\d+) cukes in my belly$")
public void I_have_cukes_in_my_belly(String ignored, int n) { // ignored is needed because of Arity mismatch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment