O'Reilly logo

The Cucumber Book, 2nd Edition by Steve Tooke, Aslak Hellesoy, Matt Wynne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What We Just Learned

It’s useful to think of a step definition as being a special kind of method. Unlike a regular Ruby method, whose name has to match exactly, a step definition can be invoked by any step that matches its regular expression. Because regular expressions can contain wildcards, this means you have the flexibility to make the Gherkin steps nice and readable, while keeping your Ruby step definition code clean and free of duplication.

  • Step definitions provide a mapping from the Gherkin scenarios’ plain-language descriptions of user actions into Ruby code, which simulates those actions.

  • Step definitions are registered with Cucumber by calling Given, When, Then, or one of the aliases for your spoken language.

  • Step definitions use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required