testing

Testing tools, testing philosophy & methodology...
metametadata 2016-12-06T10:06:14.000005Z

you could write a totally custom helper function/macro for checking the thrown exception without using (is (thrown? ,,,)), smt. like this:

(defn is-thrown
  [expr-under-test expected-stuff-about-the-exception]
  (try
     (expr-under-test)
     (catch e
        ; assert the exception here; test can be failed using (is nil "message here")
))
; fail test if exception was not thrown at all
)

metametadata 2016-12-06T10:11:55.000011Z

then use it in the tests like this: (is-thrown #(my-func 1 2 3) {:expected-ex-data {}})

karlis 2016-12-06T15:06:58.000013Z

yeah, this seems like the way to go, thanks for the ideas!