Utilities for clojure.spec.
Make sure [spec-coerce "1.0.0-alpha9"]
(or similar) is present on the classpath and loaded if you want to use nedap.util.spec.api/coerce-map-indicating-invalidity
.
[com.nedap.staffing-solutions/utils.spec "1.5.1"]
Note that self-hosted ClojureScript (e.g. Lumo) is unsupported at the moment.
-
In JVM Clojure, set
*assert*
tofalse
. -
In ClojureScript, set
:elide-asserts
totrue
.
Please browse the public namespaces, which are documented, speced and tested.
In case of a failure the check!
macro will print an explanation and throw an exception. It's recommended not to swallow
these exceptions and rely on exception reporting to discover failures.
It's possible to modify the spec-failure printing by setting nedap.utils.spec.print-symbol
to any fully qualified symbol.
In cases where a check!
spec-failure is printed, but the stacktrace is swallowed, one can debug the origin by setting
the java property nedap.utils.spec.print-stack-frames
to a positive number to print that amount of stackframes before
the exception is raised.
Copyright © Nedap
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0