Fork me on GitHub

@gfredericks: I don’t know if you’re interested in adding me as a contributor to schpec, but I’d be happy to add e.g. CI and review PRs.


is there a test runner for specs now? the documentation for fdef references clojure.spec.test/run-tests but I can't seem to find that function


@jstokes: The short answer is "no". Rich has talked about this on the mailing list and in the Cognicast and it sounds like they want clojure.spec to be test tool neutral. You can already use it with clojure.test, Expectations, etc however you want so you can use your existing test runner setup if you want. But clojure.spec is kind of different to regular tests...

seancorfield04:08:22 may well want to (instrument) your application while running your normal test suite or even while just developing...


...but generative tests don't always fit in with fast-running "unit" style tests so you probably don't want to just run those in amongst your regular tests.


@seancorfield: thanks! that makes a lot of sense


i noticed that some of my specs do take a while to run, so probably dont want that included in my normal cider-test workflow


What I’ve always wanted with test.check is a nice way to run the generative tests as part of the usual unit-test suite, but with a much smaller number of tests. And then run them separately with the full deal.


(1000 tests is nicely exhaustive; 25 is a decent sanity check.)


I suspect there’s a way to do that that I haven’t figured out yet.


Ah, nice. Thanks!


how would you use test.chuck with specs? clojure.spec.test/check returns the check results, not something you can plug in to defspec, right?


you'd probably reimplement something similar that passes num-tests to clojure.spec.test/check


ah ok, i didn’t know if that was already in place


something like that could be added to schpec


I’m writing stuff that produces (s/and …) specs and generates a pred for it; I’d like to make the error message more useful. Right now it just says something silly like:

             ({:path [:test-schema.root/item-0],
               :pred (subset? (set (keys %)) all-props),
               :val {:a 1},
               :via [:test-schema/root :test-schema.root/item-1],
               :in []})}
all-props is a set. It’d be much more useful if it showed the actual set. s/and inspects the form, so I can’t quite figure out how to do that — eval doesn’t quite work because then you get the ugly syntax-quoted form


how can I communicate the value of all-props for when it fails? Write my own Spec impl?


bsima: def is a special form, you can't exclude it


In that case, does having it in the exclude clause have any effect?


not that I know of


exclude is silent when the thing doesn't exist