RUBY-249 Alias Cursor#next for Cursor#next_document
This commit is contained in:
parent
2690520afa
commit
8df0ff23f5
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue