Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Last active December 18, 2015 07:29
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 xconnecting/5746530 to your computer and use it in GitHub Desktop.
Save xconnecting/5746530 to your computer and use it in GitHub Desktop.
[Groovy] cucumber-jvm-groovy sample (step definition)
this.metaClass.mixin(cucumber.runtime.groovy.Hooks)
this.metaClass.mixin(cucumber.runtime.groovy.EN)
Given(~'^I have a hello app with "([^"]*)"$') { String arg1 ->
hello = new Hello(arg1)
}
When(~'^I ask it to say hi$') { ->
hi = hello.sayHi();
}
Then(~'^it should answer with "([^"]*)"$') { String arg1 ->
assert arg1 == hi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment