Refactor to use monger.collection/insert-batch here

This commit is contained in:
Michael S. Klishin 2011-08-29 20:53:30 +04:00
parent 436cc4a00f
commit 5473ff10ba

View file

@ -33,7 +33,7 @@
;; ;;
;; insert ;; insert-batch
;; ;;
(deftest insert-a-batch-of-basic-documents-without-ids-and-with-default-write-concern (deftest insert-a-batch-of-basic-documents-without-ids-and-with-default-write-concern
@ -61,10 +61,10 @@
(let [collection "things"] (let [collection "things"]
(monger.collection/remove collection) (monger.collection/remove collection)
(is (= 0 (monger.collection/count collection))) (is (= 0 (monger.collection/count collection)))
(monger.collection/insert collection { :language "Clojure", :name "monger" }) (monger.collection/insert-batch collection [{ :language "Clojure", :name "langohr" },
(monger.collection/insert collection { :language "Clojure", :name "langohr" }) { :language "Clojure", :name "monger" },
(monger.collection/insert collection { :language "Clojure", :name "incanter" }) { :language "Clojure", :name "incanter" },
(monger.collection/insert collection { :language "Scala", :name "akka" }) { :language "Scala", :name "akka" }] )
(is (= 4 (monger.collection/count collection))) (is (= 4 (monger.collection/count collection)))
(is (= 3 (monger.collection/count collection { :language "Clojure" }))) (is (= 3 (monger.collection/count collection { :language "Clojure" })))
(is (= 1 (monger.collection/count collection { :language "Scala" }))) (is (= 1 (monger.collection/count collection { :language "Scala" })))