diff --git a/src/mount/core.cljc b/src/mount/core.cljc index 4973067..e3b16cf 100644 --- a/src/mount/core.cljc +++ b/src/mount/core.cljc @@ -244,10 +244,14 @@ (remove (comp :sub? @meta-state) (find-all-states))) (defn start [& states] - (if (-> states first coll?) - (apply start (first states)) - (let [states (or (seq states) (all-without-subs))] - {:started (bring states up <)}))) + (let [fs (-> states first)] + (if (coll? fs) + (if-not (empty? fs) ;; (mount/start) vs. (mount/start #{}) vs. (mount/start #{1 2 3}) + (apply start fs) + {:started #{}}) + (let [states (or (seq states) + (all-without-subs))] + {:started (bring states up <)})))) (defn stop [& states] (let [states (or states (find-all-states)) diff --git a/test/core/mount/test/composable_fns.cljc b/test/core/mount/test/composable_fns.cljc index ab7ff5b..c7ecdb8 100644 --- a/test/core/mount/test/composable_fns.cljc +++ b/test/core/mount/test/composable_fns.cljc @@ -154,4 +154,10 @@ (is (= {:datomic {:uri "datomic:mem://composable-mount"}} (dval config))) (is (instance? datomic.peer.LocalConnection (dval conn))) (is (vector? (dval nrepl))) + (mount/stop))) + + (testing "should not start anything on empty seq of states" + (let [scope #{}] + (is (= {:started #{}} (-> (only scope) + mount/start))) (mount/stop)))))