I have possibly the most simple test failing with a rather confusing message for Clojure newbie.
(ns leiningen.booltest
(:use clojure.test))
(with-test
(defn bool-function []
(true))
(is (= (bool-function) true))
)
ERROR in (bool-function) (booltest.clj:10)
expected: (= (bool-function) true)
actual: java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn
You are calling true as a function: (true) on line 3 of your with-test expression. It should simply be true, without the surrounding parentheses.
You can further simplify your expression, since bool-function already returns true:
(with-test
(defn bool-function []
true)
(is (bool-function)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With