From c2b72a3f3c6eb2e666d0d17e96277dd266293779 Mon Sep 17 00:00:00 2001 From: Fedor Yudanov Date: Fri, 5 Apr 2013 20:28:58 +0700 Subject: [PATCH] #50 - advanced tests (test 15) --- rbejdb/test/t2.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rbejdb/test/t2.rb b/rbejdb/test/t2.rb index 5f8ec26..50be66c 100644 --- a/rbejdb/test/t2.rb +++ b/rbejdb/test/t2.rb @@ -398,4 +398,18 @@ class EJDBTestUnit < Test::Unit::TestCase puts "test_ejdbd_tx1 has passed successfull" end + + def test_ejdbe_create_collection_on_upsert + assert_not_nil $jb + assert $jb.is_open? + + results = $jb.update("upsertcoll", {:foo => "bar", "$upsert" => {:foo => "bar"}}) + assert_equal(1, results.count) + + obj = $jb.find_one("upsertcoll", {:foo => "bar"}) + assert_equal("bar", obj["foo"]) + + puts "test_ejdbe_create_collection_on_upsert has passed successfull" + end + end -- 2.7.4