I want to do generative testing with clojure.spec, specifically both
positive and negative tests. Is clojure.spec intended to be used in this
way?
Suppose I have this function which accepts external input from the user:
(defn handle-action [[action payload]]
(case action
:create (do-create payload)
:delete (do-delete payload)
:else "Action not recognized"))
Somewhere in my tests, I need to test the "else" condition.
Should I create a spec for "action" as #{:create :delete}, and therefore
have my generator produce only valid values?
Or should I spec "action" as any possible keyword?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.