aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/mock.clj
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-11-28 13:46:45 -0500
committerRich Hickey <richhickey@gmail.com>2009-11-28 13:46:45 -0500
commita4a4a534d7dddc1d58fc93a216192bf4bb7b20ff (patch)
tree126b3bc2589db00b29501a2d7b42efb365c0ff0b /src/clojure/contrib/mock.clj
parent59b6a660707837af10b69cc67fe9033ba528d22f (diff)
added :dynamic annotations to mock
Diffstat (limited to 'src/clojure/contrib/mock.clj')
-rw-r--r--src/clojure/contrib/mock.clj13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/clojure/contrib/mock.clj b/src/clojure/contrib/mock.clj
index e079719d..a284b527 100644
--- a/src/clojure/contrib/mock.clj
+++ b/src/clojure/contrib/mock.clj
@@ -62,21 +62,28 @@
;; the test framework of your choice, or to simply customize error handling.
(defn report-problem
+ {:dynamic true}
([function expected actual]
(report-problem function expected actual "Expectation not met."))
([function expected actual message]
(prn (str message " Function name: " function
" expected: " expected " actual: " actual))))
-(defn no-matching-function-signature [function expected actual]
+(defn no-matching-function-signature
+ {:dynamic true}
+ [function expected actual]
(report-problem function expected actual
"No matching real function signature for given argument count."))
-(defn unexpected-args [function expected actual i]
+(defn unexpected-args
+ {:dynamic true}
+ [function expected actual i]
(report-problem function expected actual
(str "Argument " i " has an unexpected value for function.")))
-(defn incorrect-invocation-count [function expected actual]
+(defn incorrect-invocation-count
+ {:dynamic true}
+ [function expected actual]
(report-problem function expected actual "Unexpected invocation count."))