(defmethod assert-expr 'raised? [msg [_ error-type & body :as form]] (let [error-name (qualify-sym error-type)] `(with-handler (do ~...@body (report :fail ~msg '~form ~(str error-name " not raised."))) (handle ~error-type {:as err#} (report :pass ~msg '~form nil)) (handle *error* {:as err#} (report :fail ~msg '~form (:tag err#))))))
You're right I think the entire first handle statement was wrong. I believe handle does the isa? check on the error type, correct? If so then this will allow inherited error types to pass the test. Many, many thanks for the feedback. test-is + error-kit is a great combo. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---