Added a test for insertion of multiple objects at once.

This commit is contained in:
Jim Menard 2009-01-23 08:33:26 -05:00
parent 5e3a30fc9a
commit 75ae71cb49

View File

@ -47,6 +47,17 @@ class DBAPITest < Test::Unit::TestCase
assert docs.detect { |row| row['b'] == 4 } assert docs.detect { |row| row['b'] == 4 }
end end
def test_insert_multiple
@coll.insert({'a' => 2}, {'b' => 3})
assert_equal 3, @coll.count
docs = @coll.find().to_a
assert_equal 3, docs.length
assert docs.detect { |row| row['a'] == 1 }
assert docs.detect { |row| row['a'] == 2 }
assert docs.detect { |row| row['b'] == 3 }
end
def test_find_simple def test_find_simple
@r2 = @coll.insert('a' => 2) @r2 = @coll.insert('a' => 2)
@r3 = @coll.insert('b' => 3) @r3 = @coll.insert('b' => 3)