Created
January 25, 2010 09:04
-
-
Save ordnungswidrig/285739 to your computer and use it in GitHub Desktop.
This file contains 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
;; functions under test | |
(defn xx [a b] | |
10) | |
(defn yy [z] | |
20) | |
(defn fn-under-test [] | |
(xx 1 2) | |
(yy "blah")) | |
(defn another-fn-under-test [] | |
(+ (xx nil nil) (yy nil))) | |
;; mocking à la clojure | |
(deftest test-basic-mocking | |
(mocking [xx yy] | |
(fn-under-test)) | |
(verify-call-times-for xx 1) | |
(verify-call-times-for yy 1) | |
(verify-first-call-args-for xx 1 2) | |
(verify-first-call-args-for yy "blah")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment