aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_contrib/expect_test
diff options
context:
space:
mode:
authorAaron Bedra and Stuart Halloway <pair@thinkrelevance.com>2009-08-23 13:56:31 -0400
committerAaron Bedra and Stuart Halloway <pair@thinkrelevance.com>2009-08-23 13:56:31 -0400
commitf9808c1e39e73bbf6234624e4f79c9e91dfcfd22 (patch)
tree3213869c093287da0d27250db620b94dbdd1961e /src/clojure/contrib/test_contrib/expect_test
parentcf4790b017ab4d2840f9d224abfa9c6023f71262 (diff)
got tests passing for clojure.contrib.expect
* had to use fully-qualified symbols in test-has-matching-signature. Should be a better way
Diffstat (limited to 'src/clojure/contrib/test_contrib/expect_test')
-rw-r--r--src/clojure/contrib/test_contrib/expect_test/util.clj8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/clojure/contrib/test_contrib/expect_test/util.clj b/src/clojure/contrib/test_contrib/expect_test/util.clj
new file mode 100644
index 00000000..a7f0fea9
--- /dev/null
+++ b/src/clojure/contrib/test_contrib/expect_test/util.clj
@@ -0,0 +1,8 @@
+(ns clojure.contrib.test-contrib.expect-test.util
+ (:use clojure.test))
+
+(defmacro assert-called [fn-name called? & body]
+ `(let [called-status?# (atom false)]
+ (binding [~fn-name (fn [& args#] (swap! called-status?# (fn [& args#] true)))] ~@body)
+ (is (= ~called? @called-status?#))))
+