Last active
August 29, 2015 14:17
-
-
Save rksm/4a6c0116b32046290af3 to your computer and use it in GitHub Desktop.
testing with dynamically bound vars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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