aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_contrib/expect_test.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib/test_contrib/expect_test.clj')
-rw-r--r--src/clojure/contrib/test_contrib/expect_test.clj7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/clojure/contrib/test_contrib/expect_test.clj b/src/clojure/contrib/test_contrib/expect_test.clj
index 90528e89..941a0d69 100644
--- a/src/clojure/contrib/test_contrib/expect_test.clj
+++ b/src/clojure/contrib/test_contrib/expect_test.clj
@@ -1,6 +1,5 @@
(ns clojure.contrib.test-contrib.expect-test
- (:use clojure.test
- clojure.contrib.test-contrib.expect-test.util)
+ (:use clojure.test)
(:require [clojure.contrib.expect :as expect]))
; Used as dummy dependency functions
@@ -13,6 +12,10 @@
;functions created using fn directly lack the argslist meta data
(def deffed-differently (fn [x] :ignore))
+(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?#))))
(deftest test-convenience
(testing "once"