Fix test cases with bad = forms
This commit is contained in:
parent
c26ae0835d
commit
15edf63ffd
3 changed files with 13 additions and 13 deletions
|
|
@ -12,12 +12,12 @@
|
|||
(when-not (System/getenv "CI")
|
||||
(deftest ^{:authentication true} connect-to-mongo-via-uri-without-credentials
|
||||
(let [{:keys [conn db]} (mg/connect-via-uri "mongodb://127.0.0.1/monger-test4")]
|
||||
(is (= (-> conn .getAddress ^InetAddress (.sameHost "127.0.0.1"))))))
|
||||
(is (-> conn .getAddress (.sameHost "127.0.0.1")))))
|
||||
|
||||
(deftest ^{:authentication true} connect-to-mongo-via-uri-with-valid-credentials
|
||||
(let [{:keys [conn db]} (mg/connect-via-uri "mongodb://clojurewerkz/monger:monger@127.0.0.1/monger-test4")]
|
||||
(is (= "monger-test4" (.getName db)))
|
||||
(is (= (-> conn .getAddress ^InetAddress (.sameHost "127.0.0.1"))))
|
||||
(is (-> conn .getAddress (.sameHost "127.0.0.1")))
|
||||
(mc/remove db "documents")
|
||||
;; make sure that the database is selected
|
||||
;; and operations get through.
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
(if-let [uri (System/getenv "MONGOHQ_URL")]
|
||||
(deftest ^{:external true :authentication true} connect-to-mongo-via-uri-with-valid-credentials
|
||||
(let [{:keys [conn db]} (mg/connect-via-uri uri)]
|
||||
(is (= (-> conn .getAddress ^InetAddress (.sameHost "127.0.0.1")))))))
|
||||
(is (-> conn .getAddress (.sameHost "127.0.0.1"))))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -147,14 +147,14 @@
|
|||
doc-id (mu/random-uuid)
|
||||
doc { :data-store "MongoDB", :language "Clojure", :_id doc-id }]
|
||||
(mc/insert db collection doc)
|
||||
(is (= (doc (mc/find-by-id db collection doc-id))))))
|
||||
(is (= doc (mc/find-by-id db collection doc-id)))))
|
||||
|
||||
(deftest find-full-document-by-object-id-when-document-does-exist
|
||||
(let [collection "libraries"
|
||||
doc-id (ObjectId.)
|
||||
doc { :data-store "MongoDB", :language "Clojure", :_id doc-id }]
|
||||
(mc/insert db collection doc)
|
||||
(is (= (doc (mc/find-by-id db collection doc-id))))))
|
||||
(is (= doc (mc/find-by-id db collection doc-id)))))
|
||||
|
||||
(deftest find-full-document-map-by-string-id-when-document-does-exist
|
||||
(let [collection "libraries"
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@
|
|||
doc { :created-at date, :data-store "MongoDB", :language "Clojure", :_id doc-id }
|
||||
modified-doc { :created-at date, :data-store "MongoDB", :language "Erlang", :_id doc-id }]
|
||||
(mc/insert db collection doc)
|
||||
(is (= (doc (mc/find-by-id db collection doc-id))))
|
||||
(is (= doc (mc/find-by-id db collection doc-id)))
|
||||
(mc/update db collection { :_id doc-id } { :language "Erlang" })
|
||||
(is (= (modified-doc (mc/find-by-id db collection doc-id))))))
|
||||
(is (= modified-doc (mc/find-by-id db collection doc-id)))))
|
||||
|
||||
(deftest ^{:updating true} update-document-by-id-without-upsert-using-update-by-id
|
||||
(let [collection "libraries"
|
||||
|
|
@ -44,9 +44,9 @@
|
|||
doc { :created-at date, :data-store "MongoDB", :language "Clojure", :_id doc-id }
|
||||
modified-doc { :created-at date, :data-store "MongoDB", :language "Erlang", :_id doc-id }]
|
||||
(mc/insert db collection doc)
|
||||
(is (= (doc (mc/find-by-id db collection doc-id))))
|
||||
(is (= doc (mc/find-by-id db collection doc-id)))
|
||||
(mc/update-by-id db collection doc-id { :language "Erlang" })
|
||||
(is (= (modified-doc (mc/find-by-id db collection doc-id))))))
|
||||
(is (= modified-doc (mc/find-by-id db collection doc-id)))))
|
||||
|
||||
(deftest ^{:updating true} update-nested-document-fields-without-upsert-using-update-by-id
|
||||
(let [collection "libraries"
|
||||
|
|
@ -55,9 +55,9 @@
|
|||
doc { :created-at date :data-store "MongoDB" :language { :primary "Clojure" } :_id doc-id }
|
||||
modified-doc { :created-at date :data-store "MongoDB" :language { :primary "Erlang" } :_id doc-id }]
|
||||
(mc/insert db collection doc)
|
||||
(is (= (doc (mc/find-by-id db collection doc-id))))
|
||||
(is (= doc (mc/find-by-id db collection doc-id)))
|
||||
(mc/update-by-id db collection doc-id { $set { "language.primary" "Erlang" }})
|
||||
(is (= (modified-doc (mc/find-by-id db collection doc-id))))))
|
||||
(is (= modified-doc (mc/find-by-id db collection doc-id)))))
|
||||
|
||||
|
||||
(deftest ^{:updating true} update-multiple-documents
|
||||
|
|
@ -151,7 +151,7 @@
|
|||
(is (= 1 (mc/count db collection)))
|
||||
(is (mr/updated-existing? (mc/update db collection { :language "Clojure" } modified-doc {:multi false :upsert true})))
|
||||
(is (= 1 (mc/count db collection)))
|
||||
(is (= (modified-doc (mc/find-by-id db collection doc-id))))
|
||||
(is (= modified-doc (mc/find-by-id db collection doc-id)))
|
||||
(mc/remove db collection)))
|
||||
|
||||
(deftest ^{:updating true} upsert-a-document-using-upsert
|
||||
|
|
@ -165,5 +165,5 @@
|
|||
(is (= 1 (mc/count db collection)))
|
||||
(is (mr/updated-existing? (mc/upsert db collection {:language "Clojure"} modified-doc {:multi false})))
|
||||
(is (= 1 (mc/count db collection)))
|
||||
(is (= (modified-doc (mc/find-by-id db collection doc-id))))
|
||||
(is (= modified-doc (mc/find-by-id db collection doc-id)))
|
||||
(mc/remove db collection))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue