run the test again on a unique collection

This commit is contained in:
Mike Dirolf 2009-03-09 10:21:08 -04:00
parent 5921fabfa4
commit 66cb1d492c
1 changed files with 23 additions and 0 deletions

View File

@ -59,6 +59,29 @@ class CursorTest < Test::Unit::TestCase
assert_equal 499501, count
end
def test_refill_via_get_more_alt_coll
coll = @@db.collection('test-alt-coll')
coll.clear
coll.insert('a' => 1) # collection not created until it's used
1000.times { |i|
coll.insert('a' => i)
}
count = 0
coll.find.each { |obj|
count += obj['a']
}
# do the same thing again for debugging
count2 = 0
coll.find.each { |obj|
count2 += obj['a']
}
assert_equal count, count2
assert_equal 499501, count
end
def test_close_after_query_sent
begin
cursor = @@coll.find('a' => 1)