Add valid? predicate that prints debug info to stdout.

When the predicate fails. Very usefull when used with preconditions
that by default does not print nothing.
This commit is contained in:
Andrey Antukh
2016-11-20 21:21:02 +01:00
parent 4eab2f81cf
commit 5165ac6e52

View File

@@ -31,6 +31,12 @@
:context (s/explain-data spec data))
result)))
(defn valid?
[spec data]
(if (s/valid? spec data)
true
(s/explain spec data)))
;; --- Predicates
(defn email?