From ed2b837555639301b1ca2ec7e75bafa43ca689d7 Mon Sep 17 00:00:00 2001 From: anatoly Date: Thu, 19 Nov 2015 22:28:49 -0500 Subject: [PATCH] test shell for suspendable states --- test/check/suspend_resume_test.clj | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/check/suspend_resume_test.clj diff --git a/test/check/suspend_resume_test.clj b/test/check/suspend_resume_test.clj new file mode 100644 index 0000000..fee00fc --- /dev/null +++ b/test/check/suspend_resume_test.clj @@ -0,0 +1,27 @@ +(ns check.suspend-resume-test + (:require [mount.core :as mount :refer [defstate]] + [app.config :refer [app-config]] + [app.nyse :refer [conn]] + [app :refer [nrepl]] + [clojure.test :refer :all])) + +(deftest suspendable + + ;; lifecycle + (testing "should suspend _only suspendable_ states that are currently started") + (testing "should resume _only suspendable_ states that are currently suspended") + (testing "should start all the states, except the ones that are currently suspended, should resume them instead") + (testing "should stop all: started and suspended") + + ;; start-with + (testing "when replacing a non suspendable state with a suspendable one, + the later should be able to suspend/resume, + the original should not be suspendable after resume and preserve its lifecycle fns after rollback/stop") + + (testing "when replacing a suspended state with a non suspendable one, + the later should not be suspendable, + the original should still be suspended and preserve its lifecycle fns after the rollback/stop") + + (testing "when replacing a suspended state with a suspendable one, + the later should be suspendable, + the original should still be suspended and preserve its lifecycle fns after the rollback/stop"))