aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2009-05-07 00:05:26 +0000
committerStuart Sierra <mail@stuartsierra.com>2009-05-07 00:05:26 +0000
commitc7798360fcec57ce691aabb472cf4fdada568767 (patch)
tree0910d6bc6edd5b05811e0d4cafad9d628961bb27 /src/clojure/contrib
parente17240ed0a48563a6b5131ff22a2eecba3eca47f (diff)
test_is.clj: throw meaningful exception if namespace does not exist
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r--src/clojure/contrib/test_is.clj14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj
index a7b2604b..cce68275 100644
--- a/src/clojure/contrib/test_is.clj
+++ b/src/clojure/contrib/test_is.clj
@@ -892,14 +892,14 @@ 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)]
- (report {:type :begin-test-ns, :ns ns})
- ;; If ns has a test-ns-hook function, call that:
- (if-let [v (find-var (symbol (str (ns-name ns)) "test-ns-hook"))]
+ (let [ns-obj (the-ns ns)]
+ (report {:type :begin-test-ns, :ns ns-obj})
+ ;; If the namespace has a test-ns-hook function, call that:
+ (if-let [v (find-var (symbol (str (ns-name ns-obj)) "test-ns-hook"))]
((var-get v))
- ;; Otherwise, just test every var in the ns.
- (test-all-vars ns))
- (report {:type :end-test-ns, :ns ns}))
+ ;; Otherwise, just test every var in the namespace.
+ (test-all-vars ns-obj))
+ (report {:type :end-test-ns, :ns ns-obj}))
@*report-counters*))