From the course: Behavior-Driven Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Model the domain

Model the domain - Cucumber Tutorial

From the course: Behavior-Driven Development

Start my 1-month free trial

Model the domain

- [Instructor] When we executed our feature file, Cucumber suggested implementing step definitions. When Cucumber runs a step from our scenario it looks for a step definition that matches the text for the step in our feature file and then executes it. Cucumber prints the snippets you see when it can't find your definition. We can use these to get started. I'm going to copy these snippets. The Cucumber dash dash init command created a step definitions folder inside of the features directory. Inside of step definitions, I'm going to create a new file, which I'll just call steps.rb. Inside of this file I'll paste the step definitions. Saving it, and rerunning Cucumber, the output says we have two skipped tests and one pending step, so Cucumber was able to map the steps in the feature file to our step definitions, and executed the first one, good stuff. The first definition is throwing a pending exception now, causing Cucumber to stop and thread the message we see printed here. Now we can…

Contents