This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (3)
- # beginners (98)
- # boot (24)
- # cljs-dev (13)
- # cljsrn (16)
- # clojure (97)
- # clojure-dusseldorf (2)
- # clojure-italy (2)
- # clojure-losangeles (2)
- # clojure-russia (48)
- # clojure-spec (28)
- # clojure-uk (79)
- # clojurescript (79)
- # community-development (2)
- # cursive (4)
- # datomic (35)
- # duct (1)
- # events (1)
- # fulcro (43)
- # heroku (1)
- # jobs (1)
- # lein-figwheel (2)
- # luminus (1)
- # lumo (12)
- # nyc (1)
- # off-topic (6)
- # om (1)
- # pedestal (7)
- # portkey (9)
- # proton (1)
- # re-frame (45)
- # reagent (27)
- # rum (2)
- # shadow-cljs (78)
- # spacemacs (3)
- # specter (2)
- # testing (2)
- # vim (41)
☁️ ☕ 🕔
@mccraigmccraig - I say! Big ‘ole rebuild?
not really @maleghast - mostly incremental, but quite a big increment in this current release - replacing our current direct-style messaging implementation with one which supports both newsfeed-style and direct style messaging
Well, I am glad to hear (for your sake) that you are not starting all over again, that can be a very daunting prospect 🙂
clojure is pretty good at incremental - i've only had a single nasty problem relating to incremental changes that i can remember
(which was related to moving from using the key/values of a map record as properties directly (with key-fns or destructuring) to requiring a fn to synthesize some properties from the record)
Sometimes I really like Java, sometimes, you discover they made something useful private: https://stackoverflow.com/a/15596145
Welcome, @iain.tatch 👋
Nice news on v2 of yapster @mccraigmccraig... Is it launched or in the process of development?
still in dev @yogidevbear - another few weeks to go before it hits the appstores
Well I hope it's smooth sailing all the way
me too 😬
Anyone tried mocking out auth in ring for testing before? I have the feeling I’m barking up the wrong tree.
So it can be tested like this
(defn make-app [auth] (-> routes ;; compojure defroutes blah (wrap-authorization auth) blah))
(deftest test-app-with-mocked-auth (let [app (make-app some-auth-from-namespace)]) (is (:status (app (mock/request :get "api/url/banana")))))
The backend parameter should be a plain function that accepts two parameters: request and errordata hashmap, or an instance that satisfies IAuthorization protocol.
(make-app (fn [req errordata] true)) might work?
👋 Welcome @sleepyfox
(@sleepyfox is my pair right now, welcome to the team, Dom :p)
Ok, seems to work. I think our problem was actually trying to do something crazy passing around namespaces before.
We've met btw Dom, if you remember - I used to work with Malcolm and Kris on the Sphonic project
Right now you're just the fox on the screen. I'm better with faces than projects themselves.
I presume that if one wants to pass a bunch of configuration, similar to constructor injection in OOP, then a simple hash of fns is the usual way of supplying dependencies for the ring handler?
2 options really: * Dynamic vars * A map that you pass in I don't think either is worse than the other necessarily.
The equivalent of supertest style:
the equivalent of that is https://github.com/ring-clojure/ring-mock
https://clojuredocs.org/clojure.core/bound-fn are you saying you don't use this always @mccraigmccraig? 😆 Although,
delay does the right thing & family
Which is exactly where we are, but with more things to inject a hash for config seems more elegant
yes and no, if you have lots of params i’d say yes - but it also makes it much easier to have lots of params
it’s possible to make a bunch of handlers and then combine them into one, same thing you can do with
Router in express
@dominicm ow, my eyes
actually, it doesn't look like
delay does use that... maybe it uses it via something else.
user=> @(binding [*x* 20] (delay (prn *x*))) 10 nil user=> @(binding [*x* 20] (future (prn *x*))) 20 nil
bound-fn sounds like a nightmare waiting for you to restart your app-context too