-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused about phrasing a coll-of
#22
Comments
In such situations, it's always a good idea to define a default phrase which simply returns the problem: (defphraser :default
[_ problem]
problem) with that, {:path [],
:pred int?,
:val :a,
:via [:grape/coll-of-ints],
:in [0],
:phrase.alpha/mappings {},
:phrase.alpha/via ()} here you can see that the Here we have a spec bug. Spec should use A workaround is to use a registered spec like your (s/def ::coll-of-ints (s/coll-of ::just-int)) I'll look for an existing or open an issue in the Clojure JIRA. This issue stays open until upstream is fixed. |
The following upstream issue applies: https://dev.clojure.org/jira/browse/CLJ-2168 |
Thanks @alexanderkiel, I appreciate your detailed explanation! |
Hello, I am missing how to phrase a
coll-of
. Consider the following:Tests
simplest-possible-spec-for-phrase
andcoll-of-ints-fail-pred-coll
pass as expected. On the other hand, testcoll-of-ints-fail-pred-int
fails,phrase-first
returnsnil
instead of"Expected an integer (1)"
. What am I missing ?The text was updated successfully, but these errors were encountered: