Fork me on GitHub
#clojure-spec
<
2017-08-04
>
bbrinck02:08:00

Besides core.specs.alpha, does anyone know of an open-source project with a fair number of specs?

bbrinck03:08:35

@ghadi Perfect

matan06:08:41

Thanks for yesterday's short discussion of spec.check and all of that. I guess I'd use custom leiningen tasks and all those related leiningen features, to fiddle my workflow. As for test duration, a quick glimpse reveals that the number of generated inputs/runs is a parameter, and I'd gladly use slightly longer-running tests while controlling it

yenda14:08:22

Is there a way with spec to validate maps like {:a 1 :b {:c 2}} were a is optional and c is only required when a is not present

alexmiller17:08:17

you can s/and a custom predicate to make any check you like

alexmiller17:08:37

something like (s/and (s/keys :opt-un [::a ::b]) #(if (:a %) (contains-key? (:b %) :c) true)) (can be improved, but you get the idea)

alexmiller17:08:17

I flipped the case on :a but you know

leongrapenthin23:08:59

Is there a way to prevent spec from checking fspeced lambdas with generative testing when instrumentation is enabled? It's not helpful when those functions are Callbacks that do side effects

leongrapenthin23:08:02

I'd really like a knob to disable validation of fspeced lambdas through generative testing

leongrapenthin23:08:22

Augmentation with a wrapper that checks the fspeced lambda during invocation against the fspec would be fine.

leongrapenthin23:08:43

Would be great, even more so