This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-05
Channels
- # aleph (2)
- # beginners (93)
- # boot (9)
- # cider (1)
- # cljs-dev (50)
- # cljsrn (4)
- # clojure (32)
- # clojure-russia (58)
- # clojure-spec (23)
- # clojurescript (146)
- # clojurewerkz (2)
- # component (1)
- # cursive (2)
- # hoplon (163)
- # off-topic (4)
- # om (117)
- # onyx (8)
- # pedestal (1)
- # re-frame (13)
- # reagent (34)
- # spacemacs (17)
- # test-check (1)
- # untangled (3)
@bbloom I so wanted that too, unconditionally, I could not find it and copied over s/assert
and named it valid-or-throw
😄
@richiardiandrea Done 🙂 https://gist.github.com/kennyjwilli/8bf30478b8a2762d2d09baabc17e2f10
great I'll tweet you 😉
Is there yet a way to "scope" an error done against a whole map? Given that I have:
{:x 1
:y [2 3 4 5]}
And want to validate that :x
must be contained in :y
, but I want my error message to state that it is :x
that is wrong, not the whole map.
How would I do it?s/and a function that checks that x is in y?
The error should list that function
As the failing predicate
@alexmiller I'm thinking more of the :path
of the error (I think that's the key)
I had deal with that pb recently, If you check on test.check wiki there's a page explaining how to deal with recursive gen and how to limit gen depth/size
@bbloom I think you can poke around to find how the spec for ns is implemented
(doc ns) might even help with that
(clojure.spec/form :clojure.core.specs/ns-clauses)
and clojure.spec/form