This is the skeleton of what I want to achieve
(let [temp-dir (create-temp-dir)] ; setup
(fact
(do-something-with temp-dir) => true) ; actual test
(delete-dir temp-dir)) ; teardown
The midje testing framework gives access to lexical scope (scroll down towards the end). So this is what I'd expect to work:
(against-background
(around :facts
(let [temp-dir (create-temp-dir)]
(do ?form (delete-dir temp-dir))))
(fact (do-something-with temp-dir) => true))
But the compiler complains that it can't resolve the symbol temp-dir
. Any idea how to make this work?