Created
August 26, 2017 01:06
-
-
Save bhb/329710eeeb7e23c5a0949425188731c0 to your computer and use it in GitHub Desktop.
Setting up instrumentation on clojure.core with Expound
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Set up instrumentation somewhere in your project | |
;; (only need to do this once) | |
(require '[clojure.core.specs.alpha]) | |
(require '[clojure.spec.alpha :as s]) | |
(require '[clojure.spec.test.alpha :as stest]) | |
(require '[expound.alpha :as expound]) | |
(set! s/*explain-out* expound/printer) | |
(stest/instrument) | |
;;; later on ... | |
(ns "docstring " foo.bar) | |
;; CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec: | |
;; -- Spec failed -------------------- | |
;; ("docstring " ...) | |
;; ^^^^^^^^^^^^ | |
;; should satisfy | |
;; simple-symbol? | |
;; -- Relevant specs ------- | |
;; :clojure.core.specs.alpha/ns-form: | |
;; (clojure.spec.alpha/cat | |
;; :name | |
;; clojure.core/simple-symbol? | |
;; :docstring | |
;; (clojure.spec.alpha/? clojure.core/string?) | |
;; :attr-map | |
;; (clojure.spec.alpha/? clojure.core/map?) | |
;; :clauses | |
;; :clojure.core.specs.alpha/ns-clauses) | |
;; ------------------------- | |
;; Detected 1 error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment