clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
cap10morgan 2021-04-20T16:09:49.086900Z

Is it expected behavior that s/valid? needs the test.check library and needs to construct a gen for every (nested) spec it's validating against? seems counterintuitive to me, but maybe I'm missing something.

kenny 2021-04-20T16:16:52.087Z

It's only necessary when checking fspecs.

cap10morgan 2021-04-20T16:17:54.087200Z

I'm getting "Unable to construct gen at: ..." errors when calling (s/valid? ::my-spec my-val)

kenny 2021-04-20T16:18:25.087400Z

I suspect ::my-spec uses s/fspec.

cap10morgan 2021-04-20T16:19:08.087600Z

the one it's erroring on currently looks like this: (s/def ::log-file #(instance? File %))

alexmiller 2021-04-20T16:26:52.088500Z

I agree with kenny, that this seems like what you'd see with s/fspec

alexmiller 2021-04-20T16:27:11.088700Z

and generally, s/valid? will not require test.check unless you are gen'ing

cap10morgan 2021-04-20T16:30:44.088900Z

hmm... ok. yeah, commenting out my two fdef's eliminated it. thanks!