Last active
December 15, 2015 18:09
-
-
Save timmc/5301534 to your computer and use it in GitHub Desktop.
Unexpected extra "around" wrapping in midje
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
around: start | |
around: start | |
block: start | |
around: start | |
around: start | |
before | |
around: start | |
before | |
fact: start | |
fact: end | |
after | |
around: end | |
after | |
around: end | |
around: end | |
block: end | |
around: end | |
around: end |
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 *state* (atom nil)) | |
(defn frob! | |
[a v] | |
(reset! a v)) | |
(facts "frob!" | |
(println "block: start") | |
(against-background | |
(around :facts (binding [*state* (atom nil)] | |
(println "around: start") | |
?form | |
(println "around: end")))) | |
(fact "sets things" | |
(println "fact: start") | |
(against-background | |
(before :facts (do (println "before") | |
(frob! *state* 17))) | |
(after :facts (println "after"))) | |
@*state* => 17 | |
(println "fact: end")) | |
(println "block: end")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment