Make monger.core/get-db-names return a set

This commit is contained in:
Michael S. Klishin 2012-02-20 16:06:05 +04:00
parent 7348ca9f2e
commit 7747325030
2 changed files with 4 additions and 6 deletions

View file

@ -57,9 +57,9 @@
(defn ^DB get-db-names (defn ^DB get-db-names
"Gets a list of all database names present on the server" "Gets a list of all database names present on the server"
([] ([]
(list (.getDatabaseNames *mongodb-connection*))) (get-db-names *mongodb-connection*))
([^Mongo connection] ([^Mongo connection]
(list (.getDatabaseNames connection)))) (set (.getDatabaseNames connection))))
(defn ^DB get-db (defn ^DB get-db

View file

@ -31,9 +31,7 @@
(deftest test-get-db-names (deftest test-get-db-names
(let [dbs (monger.core/get-db-names)] (let [dbs (monger.core/get-db-names)]
(is (not (empty? dbs))) (is (not (empty? dbs)))
(is (some #{"monger-test"} dbs)) (is (dbs "monger-test"))))
)
)
;; (deftest get-database-with-valid-credentials ;; (deftest get-database-with-valid-credentials
;; (let [connection (monger.core/connect) ;; (let [connection (monger.core/connect)