Skip to content

Instantly share code, notes, and snippets.

@msassak
Created December 12, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msassak/7934133 to your computer and use it in GitHub Desktop.
Save msassak/7934133 to your computer and use it in GitHub Desktop.
(deftest test-with-spy
(let [state (atom [])
spy (fn [& args] (swap! state into (vec args)))]
(with-redefs [foo.bar.ns/side-effecting-fn spy]
(fn-that-calls-side-effecting-fn :foo 1 {:whatever "hi"}))
(is (= [:foo 1 {:whatever "hi"}] @state))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment