You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing tests, it is common to want to check that a function throws in a given situation. Since the slingshot exception class is not fixed across clojure versions, and c.c.t's thrown? takes an unevaluated exception type argument, this is not straightforward.
I've added thrown+? and thrown+-with-msg? to clojure.test's multimethod for test support. For getting the thrown object, recent versions of slingshot include get-thrown-object. Please let me know what you think.
When writing tests, it is common to want to check that a function throws in a given situation. Since the slingshot exception class is not fixed across clojure versions, and c.c.t's thrown? takes an unevaluated exception type argument, this is not straightforward.
The code I am currently using for this is https://gist.github.com/1966770
The text was updated successfully, but these errors were encountered: