integrant

apa512 2019-12-27T00:09:37.017500Z

is there some recommended way of having two different implementations for the same key? in my case it's to do different things in testing.

apa512 2019-12-27T00:11:22.018100Z

having conditionals in init-key is what comes to mind but i find that ugly

2019-12-27T17:28:07.020700Z

You could use different source-paths for tests, and inside you could replace implementation.

2019-12-27T17:31:40.021Z

Like

├── dev
│   └── src
│       ├── dev.clj
│       ├── local.clj
│       ├── foobar
│       │   └── external
│       │       └── service.clj
│       └── user.clj
├── project.clj
└── src
    └── foobar
        ├── external
        │   └── service.clj
        └── main.clj

2019-12-27T17:33:13.021800Z

The example uses dev but it doesn't matter.

2019-12-27T17:33:40.022300Z

That's one of options how to do this.

apa512 2019-12-27T17:55:51.024400Z

It works but I’d like to keep the option of running tests from the repl. Now I’m redef-ing the multimethod instead.

2019-12-27T18:36:23.025300Z

AFAIK it shouldn't interfere with running tests from the repl, but it might be not very explicit