December 2014
Intermediate to advanced
350 pages
8h 43m
English
Sadly, it’s unrealistic for Cucumber to know what to do just from a step like Given a project. So we must define all the steps so that Cucumber can execute them.
When Cucumber gets a step like Given a project, it searches through all the files in the step definition folder looking for one definition that matches. What does matching mean? Let’s look at the boilerplate for that step again:
| | Given(/^a project$/) do |
| | pending |
| | end |
The first line of the definition is one of those Given/When/Then words (it doesn’t matter which one) followed by a regular expression. Cucumber matches a step to a definition when the end of the step, such as a project, matches the regular expression, such as /^a project$/. We’ll see in a little ...
Read now
Unlock full access