I have a number of midje facts that have setup/teardowns that are almost, but not quite, entirely the same.
(against-background [(before :contents (setup!)) (before :contents (data)) (before :facts (set-access)) (after :contents (teardown!)]
(facts "about this thing i am testing "
; ...
))
(against-background [(before :contents (setup!)) (before :contents (data)) (before :facts (set-other-access)) (after :contents (teardown!)]
(facts "about this other thing i am testing "
; ...
))
I would like to wrap the backgrounds into something reusable and preferably paramterizable so I can reuse them, but having trouble doing so. Midje tells me anything other than the above is not the expected background form.