RUBY-249 Alias Cursor#next for Cursor#next_document

This commit is contained in:
Kyle Banker 2011-03-15 14:24:34 -04:00
parent 2690520afa
commit 8df0ff23f5
2 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,7 @@ module Mongo
doc doc
end end
alias :next :next_document
# Reset this cursor on the server. Cursor options, such as the # Reset this cursor on the server. Cursor options, such as the
# query string and the values for skip and limit, are preserved. # query string and the values for skip and limit, are preserved.

View File

@ -395,10 +395,13 @@ class CursorTest < Test::Unit::TestCase
end end
cursor = @@coll.find cursor = @@coll.find
n = 0
while cursor.has_next? while cursor.has_next?
assert cursor.next_document assert cursor.next
n += 1
end end
assert_equal n, 200
assert_equal false, cursor.has_next? assert_equal false, cursor.has_next?
end end