From 8df0ff23f515bb6ecbf3232e66193b67bf5e629c Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Tue, 15 Mar 2011 14:24:34 -0400 Subject: [PATCH] RUBY-249 Alias Cursor#next for Cursor#next_document --- lib/mongo/cursor.rb | 1 + test/cursor_test.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mongo/cursor.rb b/lib/mongo/cursor.rb index 370a355..85f139c 100644 --- a/lib/mongo/cursor.rb +++ b/lib/mongo/cursor.rb @@ -88,6 +88,7 @@ module Mongo doc end + alias :next :next_document # Reset this cursor on the server. Cursor options, such as the # query string and the values for skip and limit, are preserved. diff --git a/test/cursor_test.rb b/test/cursor_test.rb index e7ae52d..a3e30ef 100644 --- a/test/cursor_test.rb +++ b/test/cursor_test.rb @@ -395,10 +395,13 @@ class CursorTest < Test::Unit::TestCase end cursor = @@coll.find + n = 0 while cursor.has_next? - assert cursor.next_document + assert cursor.next + n += 1 end + assert_equal n, 200 assert_equal false, cursor.has_next? end