Merge pull request #914 from revelytix/test-report-hook

Hooked clojure.test report function should pass invocation through to original fn
This commit is contained in:
Phil Hagelberg 2013-01-10 10:13:35 -08:00
commit 3d1aac4e77
2 changed files with 12 additions and 1 deletions

View file

@ -69,7 +69,8 @@
first meta :ns ns-name)))
(if (= :begin-test-ns (:type m#))
(clojure.test/with-test-out
(println "\nlein test" (ns-name (:ns m#))))
(println "\nlein test" (ns-name (:ns m#)))
(apply report# m# args#))
(apply report# m# args#))))
summary# (binding [clojure.test/*test-out* *out*]
(apply ~'clojure.test/run-tests selected-namespaces#))]

View file

@ -44,3 +44,13 @@
(deftest test-only-selector
(test sample-no-aot-project ":only" "selectors/regular")
(is (= (ran?) #{:regular})))
(def called? (atom false))
(defmethod clojure.test/report :begin-test-ns [_]
(reset! called? true))
(deftest test-report-call-through
(is (true? @called?))
(reset! called? false))