This comment outlines everything clojure.test can do. It's a quick read,
see "thrown?" and "thrown-with-msg?".

https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj#L22

Thanks,
Ambrose

On Mon, Jun 25, 2012 at 7:21 PM, Jim - FooBar(); <jimpil1...@gmail.com>wrote:

> Hey guys,
>
> the only thing I can think of in order to test whether a fn does indeed
> throw an exception when certain circumstances are met is something like
> this:
>
> (fact (try (fn-that-throws-exc bad-arg)
>         (catch Exception e :works)) => :works)
>
> I thought I can also return the actual Exception object (e) but on second
> thought I don't see any advantages...
>
> Any ideas?
>
> Jim
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscribe@**googlegroups.com<clojure%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/**group/clojure?hl=en<http://groups.google.com/group/clojure?hl=en>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to