Skip to content

Instantly share code, notes, and snippets.

@wilkes
Created July 16, 2010 14:43
Show Gist options
  • Save wilkes/478437 to your computer and use it in GitHub Desktop.
Save wilkes/478437 to your computer and use it in GitHub Desktop.
(deftest using-hooke
(let [count (atom 0)]
(defn log-create [f & args]
(let [result (apply f args)]
(when (= Company (first args))
(swap! count inc))
result))
(add-hook #'create log-create)
(try
(create Company {:name "Dell"})
(expect @count => 1)
(finally
(remove-hook #'create log-create)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment