This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-15
Channels
- # aatree (23)
- # admin-announcements (13)
- # announcements (3)
- # beginners (49)
- # boot (50)
- # braid-chat (1)
- # braveandtrue (37)
- # cider (72)
- # cljs-dev (25)
- # cljsjs (6)
- # cljsrn (37)
- # clojure (78)
- # clojure-berlin (8)
- # clojure-greece (1)
- # clojure-ireland (2)
- # clojure-madison (14)
- # clojure-new-zealand (2)
- # clojure-poland (10)
- # clojure-russia (149)
- # clojured (2)
- # clojurescript (49)
- # community-development (6)
- # core-async (37)
- # cursive (1)
- # data-science (1)
- # datomic (30)
- # emacs (4)
- # euroclojure (1)
- # funcool (1)
- # graclj (1)
- # hoplon (17)
- # jobs (2)
- # jobs-rus (45)
- # ldnclj (6)
- # mount (12)
- # off-topic (124)
- # om (270)
- # onyx (131)
- # parinfer (70)
- # perun (2)
- # proton (168)
- # re-frame (32)
- # reagent (29)
- # ring-swagger (8)
- # testing (9)
- # yada (39)
@schaueho: states can really be anything (i.e. any value), which means they can also be functions, as in send-sms
example.
your question is a bit orthogonal to mount / component. if you need to swap mongodb
state with a test-mongodb
, your test value should have the capabilities you need for your tests. you can get there with protocols (again nothing mount/component specific), with redefs, or simply with an embedded mongo db value (i.e. https://github.com/fakemongo/fongo / https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo)
Can be anything really, but a simple configuration example would be:
(defstate config
:start (edn/read-string (slurp (io/resource path)))
:bindings [path "/config.edn"])
Instead of creating a substitution that - for example - reads from another path, this way one could simply influence the path, without "repeating" the rest.
this feels more like something that should be driven by configuration.. defaults, different envs, etc.. as to command line args, I am not sure, since I don't have a solid (non (mount/args)
) solution for that yet. But I also would expect command line args to just point to a config file that would host all these defaults.
Sure, still I value your opinion in this. I think the number of use cases for it are slim, indeed. I do think it is a nice solution for command line arguments. From my updated issue: > [I think it is a] nice solution: no need for thread-local dynamic vars (which will break in parallel mode) or other fragile solutions. Bindings in that sense offer an easy, cleanly scoped and semantically clear way of passing values to states, ensuring the same values on stop as when a state was started I am just not sure if such a small number of use cases warrant including it. I have not used (nor needed) the feature in any of my defstates yet, except for a config path and CLI args.