我是初学者用Clojure 我在(ns clojuregeek.test.contact)
如何编写测试用例Clojure中
写道
(expect true (valid? "henry" "[email protected]" "9999999999" "tesxt message"))
当我通过雷音测试Clojure中运行测试用例,我发现: -
lein test clojuregeek.test.contact
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
failure in (contact.clj:32) : clojuregeek.test.contact
(expect
true
(valid? "henry" "[email protected]" "9999999999" "tesxt message"))
act-msg: exception in actual: (valid? "henry" "[email protected]" "9999999999" "tesxt message")
threw: class java.lang.ClassCastException - clojure.lang.Var$Unbound cannot be cast to java.util.concurrent.Future
noir.validation$get_errors$doInvoke (validation.clj:94)
noir.validation$errors_QMARK_$doInvoke (validation.clj:140)
on (contact.clj:34)
on (contact.clj:32)
Ran 1 tests containing 1 assertions in 178 msecs
0 failures, 1 errors.
也许这有助于:http://yogthos.net/blog/46 – sloth
很多lib-noir都没有工作,除非你把代码包装在with-noir宏中。您的错误消息告诉我这是一个黑色问题,而不是测试问题。 – amalloy