Fork me on GitHub
#clojure-spec
<
2017-04-09
>
twashing00:04:17

Basically, clojure.spec.test/check returns an empty sequence, even though :ret number? should break the function.

twashing01:04:57

Ok got it. The invocation needed to be (clojure.spec.test/check <backtick>myfn) , which I was messing up.

xiongtx02:04:11

Does it need to be backtick? Regular quote should do

twashing03:04:47

For whatever reason, the check macro needs A) (st/check `ranged-rand) B) (st/check ‘ranged-rand) will yield an empty result.

twashing03:04:20

Presumably it has to do with how the symbol is expanded?

seancorfield04:04:16

It needs to be a fully-qualified symbol name - which back tick does - or you could use my.ns/my-fn

fossifoo07:04:25

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?

fossifoo07:04:06

seems to work, i was just too dumb to get the signiture right. time for more specs i guess 😉

fossifoo09:04:50

hmm. actually i'm still stuck. does sb have working examples of instrument with :stub & :gen or :spec?

fossifoo17:04:10

thanks, but only stubbing is not enough in my case

fossifoo17:04:34

i either need to use :gen or :spec too because i need to scope the fn spec differently

fossifoo17:04:09

but in the mean time i also found an actual bug in the spec i wanted to check

fossifoo17:04:16

so it might've been that all along

fossifoo17:04:01

na, no luck. i always get Couldn't satisfy such-that predicate after 100 tries. {}

fossifoo17:04:37

but the docs make it really hard to know what should be put into :gen or :spec

fossifoo17:04:53

and the code is not very straight forward either