aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2009-08-25 21:36:57 -0400
committerStuart Halloway <stu@thinkrelevance.com>2009-08-25 21:36:57 -0400
commit75e179dd393a4f6f101f7958191461dcd398cbcc (patch)
tree8f682a8537e963983918793eb1797672f31c34ac
parent36f995f88d31a23d509c11fab889887d79a4a768 (diff)
simplifying expect_test file structure
-rw-r--r--src/clojure/contrib/test_contrib/expect_test.clj7
-rw-r--r--src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj2
-rw-r--r--src/clojure/contrib/test_contrib/expect_test/util.clj8
3 files changed, 6 insertions, 11 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"
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
index c7fceb83..df74404e 100644
--- a/src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj
+++ b/src/clojure/contrib/test_contrib/expect_test/test_adapter_test.clj
@@ -1,6 +1,6 @@
(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.contrib.test-contrib.expect-test :only (assert-called)]
clojure.test))
(deftest test-report-problem-called
diff --git a/src/clojure/contrib/test_contrib/expect_test/util.clj b/src/clojure/contrib/test_contrib/expect_test/util.clj
deleted file mode 100644
index a7f0fea9..00000000
--- a/src/clojure/contrib/test_contrib/expect_test/util.clj
+++ /dev/null
@@ -1,8 +0,0 @@
-(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?#))))
-