diff --git a/src/monger/util.clj b/src/monger/util.clj index 698251e..8651ab3 100644 --- a/src/monger/util.clj +++ b/src/monger/util.clj @@ -29,13 +29,6 @@ [] (ObjectId.)) -(defmacro with-ns - "Evaluates body in another namespace. ns is either a namespace object or a symbol. - This makes it possible to define functions in namespaces other than the current one." - [ns & body] - `(binding [*ns* (the-ns ~ns)] - ~@(map (fn [form] `(eval '~form)) body))) - (defprotocol GetDocumentId (get-id [input] "Returns document id")) diff --git a/test/monger/test/collection.clj b/test/monger/test/collection.clj index 38663d6..c785e57 100644 --- a/test/monger/test/collection.clj +++ b/test/monger/test/collection.clj @@ -8,9 +8,8 @@ [clojure stacktrace]) (:use [clojure.test])) -(monger.util/with-ns 'monger.core - (defonce ^:dynamic *mongodb-connection* (monger.core/connect)) - (defonce ^:dynamic *mongodb-database* (monger.core/get-db "monger-test"))) +(monger.core/connect!) +(monger.core/set-db! (monger.core/get-db "monger-test")) ;; diff --git a/test/monger/test/result.clj b/test/monger/test/result.clj index 8317ccb..b77e740 100644 --- a/test/monger/test/result.clj +++ b/test/monger/test/result.clj @@ -4,9 +4,8 @@ (:use [clojure.test])) -(monger.util/with-ns 'monger.core - (defonce ^:dynamic *mongodb-connection* (monger.core/connect)) - (defonce ^:dynamic *mongodb-database* (monger.core/get-db "monger-test"))) +(monger.core/connect!) +(monger.core/set-db! (monger.core/get-db "monger-test"))