What is the proper way to do the following in clojure?
(ns todo.test.models.task
(:use [clojure.test]))
(deftest main-test
(is (thrown? Exception (throw Exception "stuff")))
(is (not (thrown? Exception (+ 2 3))))
)
First testcase runs fine but the whole snippet returns “Unable to resolve symbol: thrown?”
isis a macro that looks for the symbolthrown?in its body and build tests.thrown?is not actually a function you can call. The default behaviour ofisfails the test if an exception is thrown that was not beeing looked for, so you can just remove the(not (thrown?from the above example and get the result you are looking for.