This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-09
Channels
- # beginners (41)
- # boot (4)
- # cider (36)
- # cljsrn (9)
- # clojure (365)
- # clojure-dev (1)
- # clojure-dusseldorf (1)
- # clojure-nl (1)
- # clojure-russia (3)
- # clojure-spain (1)
- # clojure-spec (19)
- # clojure-uk (1)
- # clojurescript (159)
- # code-reviews (7)
- # core-async (51)
- # cursive (2)
- # datascript (1)
- # datomic (1)
- # emacs (5)
- # figwheel (3)
- # hoplon (18)
- # incanter (1)
- # lein-figwheel (1)
- # leiningen (3)
- # lumo (145)
- # off-topic (26)
- # onyx (21)
- # re-frame (2)
- # reagent (45)
- # rum (4)
- # uncomplicate (10)
- # untangled (23)
- # yada (6)
Basically, clojure.spec.test/check
returns an empty sequence, even though :ret number?
should break the function.
Ok got it. The invocation needed to be (clojure.spec.test/check <backtick>myfn)
, which I was messing up.
For whatever reason, the check
macro needs
A) (st/check `ranged-rand)
B) (st/check ‘ranged-rand) will yield an empty result.
It needs to be a fully-qualified symbol name - which back tick does - or you could use my.ns/my-fn
when i stest/check my database access functions, the real db implementation gets called. i don't want that. i currently try to with-redefs-fn those. is that the way to go?
seems to work, i was just too dumb to get the signiture right. time for more specs i guess 😉
hmm. actually i'm still stuck. does sb have working examples of instrument with :stub & :gen or :spec?
@fossifoo some sample code i have stashed for stubbing https://gist.github.com/joshjones/90f65bb11106053240baf5c6d5a4fc2b
i either need to use :gen or :spec too because i need to scope the fn spec differently
:gen or :spec where?