Skip to content

Instantly share code, notes, and snippets.

@puredanger
Last active June 22, 2017 15:57
Show Gist options
  • Save puredanger/84c0e247aeaf3a2dbd331a12f8734e41 to your computer and use it in GitHub Desktop.
Save puredanger/84c0e247aeaf3a2dbd331a12f8734e41 to your computer and use it in GitHub Desktop.
fspec missing gen
(require '[clojure.spec.alpha :as s] '[clojure.spec.test.alpha :as stest])
(s/def ::cb (s/fspec :args (s/cat :e #(instance? Throwable %))))
(s/fdef foo :args (s/cat :e ::cb))
(defn foo [e])
(stest/instrument `foo)
(foo (fn [e] e))
ExceptionInfo Unable to construct gen at: [:e] for: (instance? java.lang.Throwable %) clojure.core/ex-info (core.clj:4727)
@hlship
Copy link

hlship commented Jun 22, 2017

That looks like a minimal version of what I'm trying to accomplish, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment