If you mean for unit tests, you can use binding , which will create new bindings for vars.
You can check out the good explanation that can be found here .
Trial unit tests with lib-noir
(ns your.test.core (:use [clojure.test]) (:require [noir.session :as s])) (binding [s/*noir-session* (atom {})] ; store new sessions (s/put! "xxxx" {:value "1234"}) (s/put! "my_session" {:value "abcdefg"}) ; run tests (is (= {:value "1234"} (s/get "xxxx"))) (is (= {:value "abcdefg"} (s/get "my_session"))))
Here you can check the source code of noir.session .
source share