From 75e179dd393a4f6f101f7958191461dcd398cbcc Mon Sep 17 00:00:00 2001 From: Stuart Halloway Date: Tue, 25 Aug 2009 21:36:57 -0400 Subject: simplifying expect_test file structure --- src/clojure/contrib/test_contrib/expect_test.clj | 7 +++++-- .../contrib/test_contrib/expect_test/test_adapter_test.clj | 2 +- src/clojure/contrib/test_contrib/expect_test/util.clj | 8 -------- 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 src/clojure/contrib/test_contrib/expect_test/util.clj 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?#)))) - -- cgit v1.2.3-18-g5258