Skip to content

Instantly share code, notes, and snippets.

@rksm
Last active August 29, 2015 14:17
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 rksm/4a6c0116b32046290af3 to your computer and use it in GitHub Desktop.
Save rksm/4a6c0116b32046290af3 to your computer and use it in GitHub Desktop.
testing with dynamically bound vars
(def ^:dynamic *test-subject* nil)
(defn subject-fixture [test]
(binding [*test-subject* {:foo 23}]
(test)))
(use-fixtures :each subject-fixture)
(deftest my-test
(is (= *test-subject*
;....
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment