Sorry if this has been answered elsewhere (in which case, please point me in the right direction), but why doesn’t clojure.spec.test.alpha/instrument test anything other than the :args of an fdef?
I was hoping to use instrumentation to replace specifying :pre and :post conditions on functions. Instrumentation would give a finer grain control over when I take a performance hit for validation, as I would only have to turn it on for functions I care about during dev.
However, it appears it doesn’t check the :ret or :fn params of the fdef. I know these can be useful for generating test data, but that isn’t very helpful for my use case.
This blog post I wrote a while back might give you some more background on Spec and the various ways it can be used, based on how it is designed to be used:
At work, we were a fairly early adopter, and tried to follow the design guidelines as much as possible.
One area where we diverged was to rely on Spec for value coercion as part of conforming and validation. We began to regret this decision after a few years but haven’t fully extricated ourselves from that! A caution against trying to swim upstream by “abusing” the intended design of a feature that Rich et al have spent a lot of time thinking about.
Although one big annoyance is the error wording is the exact same as for when the input args are wrong, you just have to figure out it is referring to the output being wrong.