Get rid of monger.util/with-ns
It was an awful hack, now replaced by a less awful one.
This commit is contained in:
parent
189d2366ab
commit
c5850bd59f
3 changed files with 4 additions and 13 deletions
|
|
@ -29,13 +29,6 @@
|
||||||
[]
|
[]
|
||||||
(ObjectId.))
|
(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
|
(defprotocol GetDocumentId
|
||||||
(get-id [input] "Returns document id"))
|
(get-id [input] "Returns document id"))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,8 @@
|
||||||
[clojure stacktrace])
|
[clojure stacktrace])
|
||||||
(:use [clojure.test]))
|
(:use [clojure.test]))
|
||||||
|
|
||||||
(monger.util/with-ns 'monger.core
|
(monger.core/connect!)
|
||||||
(defonce ^:dynamic *mongodb-connection* (monger.core/connect))
|
(monger.core/set-db! (monger.core/get-db "monger-test"))
|
||||||
(defonce ^:dynamic *mongodb-database* (monger.core/get-db "monger-test")))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,8 @@
|
||||||
(:use [clojure.test]))
|
(:use [clojure.test]))
|
||||||
|
|
||||||
|
|
||||||
(monger.util/with-ns 'monger.core
|
(monger.core/connect!)
|
||||||
(defonce ^:dynamic *mongodb-connection* (monger.core/connect))
|
(monger.core/set-db! (monger.core/get-db "monger-test"))
|
||||||
(defonce ^:dynamic *mongodb-database* (monger.core/get-db "monger-test")))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue