Skip to content

Instantly share code, notes, and snippets.

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 rickyclarkson/160597 to your computer and use it in GitHub Desktop.
Save rickyclarkson/160597 to your computer and use it in GitHub Desktop.
def Given(name: String, body: Either[String => String, (Int, String) => String]) = {
body match {
case Left(b) => b("bob")
case Right(b) => b(5, "belly")
}
}
Given("I have (\\d+) cukes in my (.*)", Right("You have " + _ + " cukes in your " + _))
Given("my name is (.*)", Left("Your name is " + _))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment