Fork me on GitHub
#clojure-spec
<
2017-04-08
>
twashing23:04:44

Consider this code

(s/def ::reqid number?)
(s/def ::subscription-element (s/keys :req [::reqid]))
(s/def ::subscriptions (s/coll-of ::subscription-element))
(defn next-reqid [scanner-subscriptions] :foo)

(s/fdef next-reqid
        :args ::subscriptions
        :ret number?)

(s/exercise-fn `next-reqid)

twashing23:04:01

1. Trying to run s/exercise-fn passing in N arguments, instead of a collection. How can I get s/exercise-fn to pass in a collection?

twashing23:04:10

2. Also, how are people using the pinned defspec-test. Running (defspec-test test-name [sut/myfn]) always passes, even if there’s bad code.

twashing23:04:38

Ok, I’ve sorted 1.… But 2. is still a thorn.