-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
cuke.clj
28 lines (27 loc) · 988 Bytes
/
cuke.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(ns leiningen.cuke
(:require [leiningen.compile :as lc]
[leiningen.core :as c]))
(defn cuke
"runs cucumber"
[project]
;; basically a reimplimentation of cli.Main that doesn't annoyingly
;; call System/exit
(lc/eval-in-project
project
`(let [~'runtime (cucumber.runtime.Runtime.
(list* ["test/cucumber"])
(cucumber.io.FileResourceLoader.) false)
mformatter# (doto (cucumber.formatter.MultiFormatter.)
(.add (.createFormatter
(cucumber.formatter.FormatterFactory.)
"pretty" System/out)))
formatter# (.formatterProxy mformatter#)]
(.run ~'runtime
(list* ["test/cucumber/features"])
(list)
formatter#
(.reporterProxy mformatter#))
(.done formatter#)
(println)
~(when-not c/*interactive?*
`(System/exit (.exitStatus ~'runtime))))))