function | previously cljs.spec/with-gen | clojure.spec.alpha/with-gen | Edit |
(with-gen spec gen-fn)
Takes a spec and a no-arg, generator-returning fn and returns a version of that spec that uses that generator
(defn with-gen
[spec gen-fn]
(let [spec (reg-resolve spec)]
(if (regex? spec)
(assoc spec ::gfn gen-fn)
(with-gen* (specize spec) gen-fn))))