alexanderkiel / phrase

Clojure(Script) library for phrasing spec problems.
Eclipse Public License 1.0
289 stars 8 forks source link

Make using :via with :default work and take precedence over :pred only #25

Open martin-senft-flexiana opened 6 years ago

martin-senft-flexiana commented 6 years ago

This makes having a single phraser cover all possible failure cases for one spec possible with (defphraser :default {:via [::some-spec]}).

alexanderkiel commented 6 years ago

I see. That would be useful for overly complex predicates were you have a defined spec on a keyword. Than it's easier to dispatch on :via instead of dispatching on the predicate.

Can you pleas add a section to the README explaining and motivating this with your example? Tanks!

martin-senft-flexiana commented 6 years ago

Thank you for your quick reaction.

I have added documentation sections for spec-specific default phrasers and phraser matching priorities.

martin-senft-flexiana commented 5 years ago

@alexanderkiel Can you please share you thoughts on the current state of this PR? I would like to know if it still makes sense to you and if it is good enough to be merged.