function | removed v1.9.542 | added v1.9.14 | 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))))