Skip to content

Instantly share code, notes, and snippets.

@jaimeagudo
Created February 13, 2014 18:24
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 jaimeagudo/8980813 to your computer and use it in GitHub Desktop.
Save jaimeagudo/8980813 to your computer and use it in GitHub Desktop.
(def best-player "Xavi")
(defn greeting
[]
(prn (format "Hi %s is the best player!", best-player)))
(defn greeting-mock
[]
(prn (format "Hi. Now %s rocks!", best-player)))
(defn foo
[]
(prn "Do stuff")
(greeting)
(prn "Do stuff"))
(with-redefs [best-player "Messi"
greeting greeting-mock]
(foo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment