-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Brief
When using spec-assertion-thrown? with a programmatic nilable spec, its spec key is not evaluated.
Repro:
(ns repro
(:require
[clojure.spec.alpha :as spec]
[clojure.test :refer :all]
[nedap.utils.spec.api :refer [check!]]))
(spec/def ::a int?)
(defn check-nilable [attr value]
(check! (spec/nilable attr) value))
(deftest my-test
(is (spec-assertion-thrown? (spec/nilable ::a) (check-nilable ::a "twelve"))))Expected behavior
Expect a spec assertion to be thrown for (spec/nilable ::a)
Actual behavior
Got a spec assertion thrown for (spec/nilable attr) (note that attr is not evaluated).
Reproduction steps
Run the reproduction case above.
Suspected cause
@thumbnail pointed me to #99, which fixes this evaluation for 'bare' programmatic specs. In this case it is, however, a programmatic spec being wrapped in nilable :).
Screenshot, stacktrace, etc
Environment info
Additional links
thumbnail
Metadata
Metadata
Assignees
Labels
No labels