mount

tolitius 2018-05-14T15:41:59.000821Z

@poulin_julien try it from REPL. might be something with MockGenerator. call or could be you calling it :once vs. :each, but REPL should reveal what does not go the way you expect it. Here is an example:

tolitius 2018-05-14T15:42:07.000420Z

boot.user=> (require '[mount.core :as mount :refer [defstate only swap-states]])
nil
boot.user=> (defstate a :start 42)
#'boot.user/a
boot.user=> (defstate b :start 34)
#'boot.user/b
boot.user=> (defstate c :start 28)
#'boot.user/c
nil
boot.user=> (-> (only [#'boot.user/a #'boot.user/b])
                (swap-states {#'boot.user/a {:start (fn [] 132)}})
                mount/start)
{:started ["#'boot.user/a" "#'boot.user/b"]}
boot.user=> a
132
boot.user=> b
34

2018-05-16T10:54:09.000272Z

OK, I found the problem and it had nothing to do with how I set up the test. It was just my own stupidity. Sorry for wasting your time 😞

tolitius 2018-05-16T12:05:01.000151Z

not a problem. glad it works 🙂