Permalink
Browse files

Binding *exit-process?* to true to exit with error code even when use…

…d with with-profile
  • Loading branch information...
1 parent d1b44f7 commit 55c24a7a5bfee070bd45cef68732beb1c36b8ce7 @nilswloka committed Jan 28, 2013
Showing with 17 additions and 16 deletions.
  1. +17 −16 src/leiningen/cucumber.clj
View
@@ -23,19 +23,20 @@
(defn cucumber
"Runs Cucumber features in test/features with glue in test/features/step_definitions"
[project & args]
- (let [runtime (gensym "runtime")
- runtime-options (create-partial-runtime-options project args)
- glue-paths (vec (.glue runtime-options))
- feature-paths (vec (.featurePaths runtime-options))
- target-path (:target-path project)
- project (project/merge-profiles project [:test])]
- (eval-in-project
- (-> project
- (update-in [:dependencies] conj
- ['lein-cucumber "1.0.2"]
- ['info.cukes/cucumber-clojure "1.1.1"])
- (update-in [:source-paths] (partial apply conj) glue-paths))
- `(do
- (let [~runtime (leiningen.cucumber.util/run-cucumber! ~feature-paths ~glue-paths ~target-path ~(vec args))]
- (leiningen.core.main/exit (.exitStatus ~runtime))))
- '(require 'leiningen.cucumber.util 'leiningen.core.main))))
+ (binding [leiningen.core.main/*exit-process?* true]
+ (let [runtime (gensym "runtime")
+ runtime-options (create-partial-runtime-options project args)
+ glue-paths (vec (.glue runtime-options))
+ feature-paths (vec (.featurePaths runtime-options))
+ target-path (:target-path project)
+ project (project/merge-profiles project [:test])]
+ (eval-in-project
+ (-> project
+ (update-in [:dependencies] conj
+ ['lein-cucumber "1.0.2"]
+ ['info.cukes/cucumber-clojure "1.1.1"])
+ (update-in [:source-paths] (partial apply conj) glue-paths))
+ `(do
+ (let [~runtime (leiningen.cucumber.util/run-cucumber! ~feature-paths ~glue-paths ~target-path ~(vec args))]
+ (leiningen.core.main/exit (.exitStatus ~runtime))))
+ '(require 'leiningen.cucumber.util 'leiningen.core.main)))))

0 comments on commit 55c24a7

Please sign in to comment.