defn-spec icon indicating copy to clipboard operation
defn-spec copied to clipboard

`:ret` spec not being instrumented

Open thiru opened this issue 2 years ago • 5 comments

I followed along with your example in the readme and everything is working as expected except that the :ret spec for my-inc isn't being instrumented. s/*compile-asserts* is true and the :args spec is instrumenting correctly.

thiru avatar Jun 12 '22 23:06 thiru

Hi @thiru. You're correct - that's the expected behavior now. I opted to simplify this library's behavior (and thus maintainability) in https://github.com/Provisdom/defn-spec/pull/9 by removing the validity checking code. It now uses the built-in instrument checking & throwing behavior. Since Spec does not check :ret with instrument, this library does not either. However, we do support Orchestra. If you have that on the classpath, you will get :ret checking since we prefer orchestra, if available.

kennyjwilli avatar Jun 13 '22 14:06 kennyjwilli

I see, yeah that's totally understandable. But maybe it's worth adding a note in the readme? As it is I suppose others may get confused as I did.

thiru avatar Jun 13 '22 15:06 thiru

Happy to submit a PR with a proposed changed if you'd be open to it?

thiru avatar Jun 18 '22 20:06 thiru

That'd be great, thanks!

kennyjwilli avatar Jun 24 '22 03:06 kennyjwilli

Just added a simple note to the readme: https://github.com/Provisdom/defn-spec/pull/17

thiru avatar Jun 26 '22 19:06 thiru