Skip to content

Commit

Permalink
make lein 2 work with lazytest, too
Browse files Browse the repository at this point in the history
- need to append classpath everywhere
- make version number information constant
- IMPROV: can we get rid of version number altogether?
  • Loading branch information
anttipoi committed Mar 11, 2012
1 parent 693dfc8 commit e0d317b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/leiningen/midje.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
(def leiningen-two-in-use? false)
(use '[leiningen.compile :only [eval-in-project]])))

(def PLUGIN_VERSION "1.0.9")

(defn- make-run-fn []
`(fn [& namespaces#]
;; This turns off "Testing ...." lines, which I hate, especially
Expand Down Expand Up @@ -128,7 +130,9 @@
when they change.
NOTE: Requires lazytest dev-dependency."
[project & lazytest-or-namespaces]
(let [lazy-test-mode? (= "--lazytest" (first lazytest-or-namespaces))
(let [project (update-in project [:dependencies]
conj ['lein-midje PLUGIN_VERSION])
lazy-test-mode? (= "--lazytest" (first lazytest-or-namespaces))
paths (collect-paths project)]
(if lazy-test-mode?
(e-i-p
Expand All @@ -145,8 +149,7 @@
(namespaces-on-classpath :classpath (map #(java.io.File. %) paths))
(get-namespaces namespaces))]
(e-i-p
(update-in project [:dependencies]
conj ['lein-midje "1.0.9"])
project
`(~(make-report-fn *exit-after-tests*) (apply ~(make-run-fn) '~desired-namespaces))
'(require '[clojure walk template stacktrace test string set]
'[leinmidje.midje-color :as color]))))))

0 comments on commit e0d317b

Please sign in to comment.