summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Hagelberg <technomancy@gmail.com>2009-10-07 10:54:52 -0700
committerChouser <chouser@n01se.net>2009-10-28 22:33:46 -0400
commitf5f2943dfd0128744227c3f42a630ea10dd40b24 (patch)
tree02aa06ac10224c9ce16b94c87bf5264313106163 /src
parent6aab0f20e6bcc897b86a77b728af6fa0df93a2d8 (diff)
Don't repeatedly compose on calls to use-fixtures. Fixes #194.
Updated tests and added a docstring to use-fixtures. Signed-off-by: Chouser <chouser@n01se.net>
Diffstat (limited to 'src')
-rw-r--r--src/clj/clojure/test.clj8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj
index 0d7c4600..9be6dc0d 100644
--- a/src/clj/clojure/test.clj
+++ b/src/clj/clojure/test.clj
@@ -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))