clojure-spec

Benjamin 2022-02-07T12:17:06.880929Z

(defn foo [] 'fo)
(s/fdef foo :ret int?)
(stest/instrument `foo)
(foo)
I don't get how :ret in fdef works. Why doesn't it throw when I do this?

2022-02-07T12:19:03.304389Z

ret specs are not instrumented by stest/instrument

Benjamin 2022-02-07T12:19:19.953899Z

ah

2022-02-07T12:22:09.892509Z

you can use stest/check to check the entire function spec, as per https://clojure.org/guides/spec#_testing

1