aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_contrib/expect_test/util.clj
blob: a7f0fea9ad68eceafcb850a8976c1adccacd70bd (plain)
1
2
3
4
5
6
7
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?#))))