From acaf635e3314e234fe4a634e0a511e38d39be692 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Wed, 11 Mar 2009 13:37:42 -0400 Subject: [PATCH] count checks --- tests/test_cursor.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_cursor.rb b/tests/test_cursor.rb index cab6985..a2594bd 100644 --- a/tests/test_cursor.rb +++ b/tests/test_cursor.rb @@ -44,12 +44,17 @@ class CursorTest < Test::Unit::TestCase 1000.times { |i| @@coll.insert('a' => i) } + + assert_equal 1001, @@coll.count + count = 0 @@coll.find.each { |obj| count += obj['a'] } # do the same thing again for debugging + assert_equal 1001, @@coll.count + count2 = 0 @@coll.find.each { |obj| count2 += obj['a'] @@ -67,12 +72,17 @@ class CursorTest < Test::Unit::TestCase 1000.times { |i| coll.insert('a' => i) } + + assert_equal 1001, coll.count + count = 0 coll.find.each { |obj| count += obj['a'] } # do the same thing again for debugging + assert_equal 1001, coll.count + count2 = 0 coll.find.each { |obj| count2 += obj['a']