mount/test/core/mount/test/helper.cljc
anatoly a75b087b8f [boot]: moving tests to test/core
to avoid "boot => The :source-paths, :resource-paths, and :asset-paths must not overlap."
2015-12-20 19:22:17 -05:00

20 lines
547 B
Clojure

(ns mount.test.helper
(:require
#?@(:cljs [[mount.core :as mount :refer-macros [defstate]]]
:clj [[mount.core :as mount :refer [defstate]]])))
#?(:clj (alter-meta! *ns* assoc ::load false))
(defn dval
"returns a value of DerefableState without deref'ing it"
[d]
(-> (@@(var mount.core/meta-state)
#?(:clj (.name d)
:cljs (.-name d)))
:inst
deref))
(def forty-two (atom 42))
(defstate helper :start :started
:stop (reset! forty-two :cleaned))