Fork me on GitHub
#leiningen
<
2020-02-21
>
peter hull16:02:09

I've got some specs in my code that use with-gen but now I can't lein uberjar the project because test.check is only specified for the dev profile in lein, not the uberjar one. What's the best way round this?

mikerod16:02:13

@peterhull90 spec is setup to not require this at runtime

mikerod16:02:28

unless you are using instrument or something at runtime in your uberjar execution

mikerod16:02:01

you use (require '[clojure.spec.gen.alpha :as gen])

mikerod16:02:41

and s/with-gen you give the generator as a no arg fn

mikerod16:02:52

so it’s all shielded behind the clojure.spec.gen.alpha layer

mikerod16:02:19

which will only lazy load/require org.clojure/test.check ns’s

peter hull16:02:05

@mikerod oho I am using instrument but I forgot about that. It was only for testing so I don't need it. Thanks a lot!

mikerod16:02:14

@peterhull90 nice. yeah that makes sense. just have to be careful where you use that sort of thing - keep it in dev-only ns’s/tests/etc