Recipe 21Test Clojure Code

Problem

You want to test your Clojure project using Cucumber. You have unit tests in place for individual pieces of Clojure code but want to write your higher-level integration tests in English.

Ingredients

  • Leiningen[130] for installing Clojure and dependencies

  • lein-cucumber[131] for connecting Cucumber to Clojure

Solution

Leiningen is a tool for automatically tracking and installing the dependencies for your Clojure project—including Clojure itself. If you’re a Clojure developer, you’re likely already using Leiningen. If you’re new to Leiningen, all you have to do is download a single script[132] or Windows batch file.[133] For this recipe, we’ll use Leiningen 2.0.

Once you’ve downloaded Leiningen and saved it ...

Get Cucumber Recipes 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.