diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-11-02 10:41:23 -0500 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2009-11-02 10:41:23 -0500 |
commit | 7e11a5525bc35083ebdf53484cbdfb76755b252f (patch) | |
tree | 1ae708f568b1e152fda21df2c4460e0313c18c6b /src/clojure/contrib/test_is.clj | |
parent | e0080e640a2d9b79564a3fb6eb7ee36be1882901 (diff) |
test-is: don't compose fixtures forever; fixes #36
This is the same as Clojure ticket #194, same changes applied.
clojure.contrib.test-is/use-fixtures would compose fixtures repeatedly
when called multiple times.
Diffstat (limited to 'src/clojure/contrib/test_is.clj')
-rw-r--r-- | src/clojure/contrib/test_is.clj | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/clojure/contrib/test_is.clj b/src/clojure/contrib/test_is.clj index 7175fa2a..dcfb0564 100644 --- a/src/clojure/contrib/test_is.clj +++ b/src/clojure/contrib/test_is.clj @@ -505,7 +505,7 @@ Chas Emerick, Allen Rohner, and Stuart Halloway", "Returns a vector [filename line-number] for the nth call up the stack." [n] - (let [s (nth (.getStackTrace (new java.lang.Throwable)) n)] + (let [#^StackTraceElement s (nth (.getStackTrace (new java.lang.Throwable)) n)] [(.getFileName s) (.getLineNumber s)])) (defn testing-vars-str @@ -825,9 +825,13 @@ Chas Emerick, Allen Rohner, and Stuart Halloway", "Adds elements in coll to the current namespace metadata as the value of key." [key coll] - (alter-meta! *ns* assoc key (concat (key (meta *ns*)) coll))) + (alter-meta! *ns* assoc key coll)) -(defmulti use-fixtures (fn [fixture-type & args] fixture-type)) +(defmulti use-fixtures + "Wrap test runs in a fixture function to perform setup and + teardown. Using a fixture-type of :each wraps every test + individually, while:once wraps the whole run in a single function." + (fn [fixture-type & args] fixture-type)) (defmethod use-fixtures :each [fixture-type & args] (add-ns-meta ::each-fixtures args)) |