Talk is cheap

We have talked enough about BDD. There is no alternative to getting our hands on the steering wheel. Let us look at setting up BDD scenarios in our example application using Cucumber.

We will need to introduce the Cucumber library dependencies that we will need to include in our SBT-build descriptor. Along with Cucumber, we will also need dependencies for JUnit. This is because I have always found it easier to integrate Cucumber with SBT using JUnit. There are some third-party SBT plugins that also allow for Cucumber and SBT integration, but since they are not maintained by LightBend (previously known as TypeSafe), they are not up-to-date with the latest Scala and SBT versions.

Adding Cucumber dependency

With the new library dependencies ...

Get Scala Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.