aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/test_contrib/mock_test/test_adapter_test.clj
blob: 5f21ce11c7145be63b868d340782df9973cc4376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(ns clojure.contrib.test-contrib.mock-test.test-adapter-test
 (:use clojure.contrib.mock.test-adapter
   [clojure.contrib.test-contrib.mock-test :only (assert-called)]
   clojure.test))

(deftest test-report-problem-called
  (def #^{:private true :dynamic true} fn1 (fn [x] "dummy code"))
  (def #^{:private true :dynamic true} fn2 (fn [x y] "dummy code2"))
  (let [under-test (fn [x] (fn1 x))]
    (assert-called clojure.contrib.mock.test-adapter/report-problem
      true (expect [fn1 (times 5)] (under-test "hi")))))

(deftest test-is-report-called
  (assert-called clojure.test/report true
    (clojure.contrib.mock.test-adapter/report-problem
      'fn-name 5 6 "fake problem")))