summaryrefslogtreecommitdiff
path: root/test
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 /test
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 'test')
-rw-r--r--test/clojure/test_clojure/test_fixtures.clj11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/clojure/test_clojure/test_fixtures.clj b/test/clojure/test_clojure/test_fixtures.clj
index 9a85b58b..0a6ff51a 100644
--- a/test/clojure/test_clojure/test_fixtures.clj
+++ b/test/clojure/test_clojure/test_fixtures.clj
@@ -16,6 +16,8 @@
(declare *a* *b* *c* *d*)
+(def *n* 0)
+
(defn fixture-a [f]
(binding [*a* 3] (f)))
@@ -28,9 +30,13 @@
(defn fixture-d [f]
(binding [*d* 11] (f)))
+(defn inc-n-fixture [f]
+ (binding [*n* (inc *n*)] (f)))
+
(use-fixtures :once fixture-a fixture-b)
-(use-fixtures :each fixture-c fixture-d)
+(use-fixtures :each fixture-c fixture-d inc-n-fixture)
+(use-fixtures :each fixture-c fixture-d inc-n-fixture)
(deftest can-use-once-fixtures
(is (= 3 *a*))
@@ -39,3 +45,6 @@
(deftest can-use-each-fixtures
(is (= 7 *c*))
(is (= 11 *d*)))
+
+(deftest use-fixtures-replaces
+ (is (= *n* 1))) \ No newline at end of file