From f4c2b97bc6ffedb83f762c851dffe0932bc26a1e Mon Sep 17 00:00:00 2001 From: Ryan Senior Date: Thu, 10 Jan 2013 10:58:07 -0600 Subject: [PATCH] changed leiningen/test to allow the call into the clojure.test report to pass through the hook to the original multimethod --- src/leiningen/test.clj | 3 ++- test/leiningen/test/test.clj | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/leiningen/test.clj b/src/leiningen/test.clj index 492911a6..e6352965 100644 --- a/src/leiningen/test.clj +++ b/src/leiningen/test.clj @@ -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#))] diff --git a/test/leiningen/test/test.clj b/test/leiningen/test/test.clj index f9444c56..c267e056 100644 --- a/test/leiningen/test/test.clj +++ b/test/leiningen/test/test.clj @@ -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)) +