Hi,
I trying to use clojure.contrib.mock. It says to override the function
report-problem to
integrate it into other test framework like clojure.test.
I've got this working, but the namespace switching looks a bit ugly.
Is there a better
way to handle this? Maybe something like
(ns clojure.contrib.mock
(defn... the override)
)
which avoids the extra code to switch back to the original namespace?
(ns apfloattest
(:use
apfloat
clojure.test
clojure.contrib.mock))
(ns clojure.contrib.mock
(:use
clojure.test))
; delegate mock reporting to clojure.test
(defn report-problem
([function expected actual message]
(is (= expected actual)
(str message " Function name: " function))))
(ns apfloattest)
(deftest test-sqrtf
(expect [apf (times 1 (returns (apf 5)))] (sqrtf 5)))
--
Martin
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to
clojure+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.