Skip to content

Instantly share code, notes, and snippets.

@c-garcia
Created April 10, 2016 09:43
Show Gist options
  • Save c-garcia/913f84a472223820839f05fe200a8647 to your computer and use it in GitHub Desktop.
Save c-garcia/913f84a472223820839f05fe200a8647 to your computer and use it in GitHub Desktop.
How to use cucumber-jvm without lein-cucumber
(ns cucutest.features
(:require [clojure.test :refer :all])
(:import [cucumber.api.cli Main]))
(deftest ^:cucumber run-cucumber
(let [cucumber-args ["--plugin" "progress" "--glue" "test/features/step_definitions" "test/features"]]
(Main/main (into-array cucumber-args))))
;; given the features in test/features
;; and the step definitions in test/features/step_definitions
;; lein pep will execute the features in the test/features directory
;; via the test in test/cucutest/features.clj file
;; which is marked as :cucumber
(defproject cucutest "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:profiles {:dev {:dependencies [[info.cukes/cucumber-clojure "1.2.4"]]}
:cucumber-run {:test-paths ["test/features/step_definitions"]}}
:test-selectors {:default (complement :cucumber)
:cucumber :cucumber
:all (constantly true)}
:aliases {"pep" ["with-profile" "+cucumber-run" "test" ":cucumber"]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment