diff options
author | Aaron Bedra and Stuart Halloway <pair@thinkrelevance.com> | 2009-08-23 14:06:35 -0400 |
---|---|---|
committer | Aaron Bedra and Stuart Halloway <pair@thinkrelevance.com> | 2009-08-23 14:06:35 -0400 |
commit | 0b8b47631efe950df74d17d8f410eb8196342359 (patch) | |
tree | d0b4fa846039c819102da1ac7a7d5de15ec12fa4 | |
parent | f9808c1e39e73bbf6234624e4f79c9e91dfcfd22 (diff) |
added adapter test
-rw-r--r-- | src/clojure/contrib/expect/test_adapter.clj (renamed from src/clojure/contrib/expect/test_is_adapter.clj) | 4 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib.clj | 2 | ||||
-rw-r--r-- | src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj | 18 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/clojure/contrib/expect/test_is_adapter.clj b/src/clojure/contrib/expect/test_adapter.clj index ebe09773..50e50125 100644 --- a/src/clojure/contrib/expect/test_is_adapter.clj +++ b/src/clojure/contrib/expect/test_adapter.clj @@ -1,4 +1,4 @@ -;;; test_is_adapter.clj: test-is adapter for mocking/expectation framework for Clojure +;;; test_adapter.clj: clojure.test adapter for mocking/expectation framework for Clojure ;; by Matt Clark @@ -9,7 +9,7 @@ ;; agreeing to be bound by the terms of this license. You must not ;; remove this notice, or any other, from this software. -(ns clojure.contrib.expect.test-is-adapter +(ns clojure.contrib.expect.test-adapter (:require [clojure.contrib.expect :as expect]) (:use clojure.test clojure.contrib.ns-utils)) diff --git a/src/clojure/contrib/test_contrib.clj b/src/clojure/contrib/test_contrib.clj index 9624e987..13498076 100644 --- a/src/clojure/contrib/test_contrib.clj +++ b/src/clojure/contrib/test_contrib.clj @@ -20,7 +20,7 @@ [:complex-numbers :fnmap :macro-utils :monads :pprint.pretty :pprint.cl-format :str-utils :shell-out :test-graph :test-dataflow :test-java-utils :test-lazy-seqs - :test-trace :test-jmx :java-utils :expect-test]) + :test-trace :test-jmx :java-utils :expect-test :expect-test.test-adapter-test]) (def test-namespaces (map #(symbol (str "clojure.contrib.test-contrib." (name %))) diff --git a/src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj b/src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj new file mode 100644 index 00000000..c7fceb83 --- /dev/null +++ b/src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj @@ -0,0 +1,18 @@ +(ns clojure.contrib.test-contrib.expect-test.test-adapter-test + (:use clojure.contrib.expect.test-adapter + [clojure.contrib.test-contrib.expect-test.util :only (assert-called)] + clojure.test)) + +(deftest test-report-problem-called + (def #^{:private true} fn1 (fn [x] "dummy code")) + (def #^{:private true} fn2 (fn [x y] "dummy code2")) + (let [under-test (fn [x] (fn1 x))] + (assert-called clojure.contrib.expect.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.expect.test-adapter/report-problem + 'fn-name 5 6 "fake problem"))) + + |