aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonrad Hinsen <konrad.hinsen@laposte.net>2009-05-05 12:56:55 +0000
committerKonrad Hinsen <konrad.hinsen@laposte.net>2009-05-05 12:56:55 +0000
commit1d80038e7605a9b4487f5a6f17de33780c8ef188 (patch)
tree2413929ae11a2f4c757e5294b568882433ba2af6
parent1dd60bdd968cd19dc04b4cb4fdcc0b6032833543 (diff)
test-is: run each test with *ns* set to its namespace
-rw-r--r--src/clojure/contrib/test_is.clj5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj
index a7b2604b..c56cdbbe 100644
--- a/src/clojure/contrib/test_is.clj
+++ b/src/clojure/contrib/test_is.clj
@@ -892,13 +892,16 @@ Chas Emerick, Allen Rohner, and Stuart Halloway",
*report-counters*."
[ns]
(binding [*report-counters* (ref *initial-report-counters*)]
- (let [ns (if (symbol? ns) (find-ns ns) ns)]
+ (let [current-ns *ns*
+ ns (if (symbol? ns) (find-ns ns) ns)]
(report {:type :begin-test-ns, :ns ns})
+ (in-ns (ns-name ns))
;; If ns has a test-ns-hook function, call that:
(if-let [v (find-var (symbol (str (ns-name ns)) "test-ns-hook"))]
((var-get v))
;; Otherwise, just test every var in the ns.
(test-all-vars ns))
+ (in-ns (ns-name current-ns))
(report {:type :end-test-ns, :ns ns}))
@*report-counters*))