Created
January 18, 2018 20:11
-
-
Save technomancy/3de56f5ff315f12cf0170567261b2a9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; works | |
(let [factory clojure.tools.logging/*logger-factory*] | |
(try | |
(alter-var-root #'clojure.tools.logging/*logger-factory* | |
(constantly clojure.tools.logging.impl/disabled-logger-factory)) | |
(is (thrown-with-msg? Exception #"Message not processed" | |
(test-utils/process-message! msg 2))) | |
(finally | |
(alter-var-root #'clojure.tools.logging/*logger-factory* factory)))) | |
;; doesn't work | |
(with-redefs [clojure.tools.logging/*logger-factory* | |
clojure.tools.logging.impl/disabled-logger-factory] | |
(is (thrown-with-msg? Exception #"Message not processed" | |
(test-utils/process-message! msg 2)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment