This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-14
Channels
- # aleph (3)
- # beginners (25)
- # cider (12)
- # clojure (42)
- # clojure-canada (3)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (13)
- # clojure-uk (24)
- # clojurescript (23)
- # cloverage (1)
- # datomic (7)
- # figwheel-main (3)
- # jobs-discuss (14)
- # onyx (48)
- # parinfer (3)
- # re-frame (20)
- # reitit (28)
- # shadow-cljs (3)
- # testing (1)
- # vim (37)
Hi everyone! I'm working on some test that use a java object. I'm thinking it would be nice to mock that out. I've gathered that reify
might be the best way to do this. This is how I'm trying to wire up my test
(let [mock (reify LDClientInterface (allFlags [client ld-user] "flags"))]
(with-redefs-fn {#'my-ns/init-client (fn [] mock)} ;; line 10
#(is= (my-ns/foo) false))
)
However I'm getting this error, which makes me think I'm wiring something wrong
java.lang.ClassCastException: circle.util.test_launchdarkly$fn$reify__106395 cannot be cast to clojure.lang.IFn
<<stack trace points to line 10>>