Fork me on GitHub

When using stest/instrument in tests, how do you clean up after a test? e.g. ` (deftest foo (stest/instrument foo {:stub foo})


right, but you don’t know what the previous state was


was it instrumented, or stub+ instrumented?

Alex Miller (Clojure team)13:09:17

Sorry, not understanding the question


We have some code that is always instrumented. During a test, if I call (instrument foo {:stub foo}), that overwrites the existing instrument with a stub+instrument. Now if I call unstrument at the end, the next test will run with foo un instrumented

Alex Miller (Clojure team)13:09:30

Instrument remembers the old var and unstrument replaces it iirc