From beef42471580d10b0df38d80ddcbccd460e0da77 Mon Sep 17 00:00:00 2001 From: anatoly Date: Sat, 14 Nov 2015 11:05:22 -0500 Subject: [PATCH] testing with parts of an app --- test/check/parts_test.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/check/parts_test.clj diff --git a/test/check/parts_test.clj b/test/check/parts_test.clj new file mode 100644 index 0000000..c2f1d1a --- /dev/null +++ b/test/check/parts_test.clj @@ -0,0 +1,17 @@ +(ns check.parts-test + (:require [mount :refer [defstate] :as m] + [app.nyse :refer [conn]] + [clojure.test :refer :all])) + +(defstate should-not-start :start (throw (RuntimeException. "should not have been started!"))) + +(defn with-parts [f] + (m/start #'app.config/app-config #'app.nyse/conn) + (f) + (m/stop #'app.config/app-config #'app.nyse/conn)) + +(use-fixtures :each with-parts) + +(deftest start-only-parts + (is (instance? datomic.peer.LocalConnection conn)) + (is (instance? mount.NotStartedState should-not-start)))