Fork me on GitHub
#clojure-spec
<
2020-09-28
>
arohner13:09:06

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

arohner13:09:57

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

arohner13:09:08

was it instrumented, or stub+ instrumented?

Alex Miller (Clojure team)13:09:17

Sorry, not understanding the question

arohner13:09:50

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