Skip to content

Instantly share code, notes, and snippets.

@jmgimeno
Created January 2, 2012 09:04
Show Gist options
  • Save jmgimeno/1549965 to your computer and use it in GitHub Desktop.
Save jmgimeno/1549965 to your computer and use it in GitHub Desktop.
Testing private methods
(defmacro with-private-fns [[ns fns] & tests]
"Refers private fns from ns and runs tests in context."
`(let ~(reduce #(conj %1 %2 `(ns-resolve '~ns '~%2)) [] fns)
~@tests))
(with-private-fns [org.foo.bar [fn1 fn2]]
(deftest test-fn1..)
(deftest test-fn2..))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment