Skip to content

Instantly share code, notes, and snippets.

@timmc
Last active December 15, 2015 18:09
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 timmc/5301534 to your computer and use it in GitHub Desktop.
Save timmc/5301534 to your computer and use it in GitHub Desktop.
Unexpected extra "around" wrapping in midje
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
(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