From b8ab13e7f922264c98d8a3ef3a3c4b194c6b46ec Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Tue, 10 May 2011 15:58:23 -0400 Subject: [PATCH] Revert "RUBY-267 Cursor#alive?" This reverts commit 05dfef2f118e089a8c9e8cd6578c215310015702. This adds new functionality and thus must wait for the 1.4 release. --- lib/mongo/cursor.rb | 7 ------- test/cursor_test.rb | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/lib/mongo/cursor.rb b/lib/mongo/cursor.rb index 9b61818..652d7af 100644 --- a/lib/mongo/cursor.rb +++ b/lib/mongo/cursor.rb @@ -307,13 +307,6 @@ module Mongo # @return [Boolean] def closed?; @closed; end - # Is this cursor alive on the server? - # - # @return [Boolean] - def alive? - @cursor_id && @cursor_id != 0 - end - # Returns an integer indicating which query options have been selected. # # @return [Integer] diff --git a/test/cursor_test.rb b/test/cursor_test.rb index 2813ba9..7942169 100644 --- a/test/cursor_test.rb +++ b/test/cursor_test.rb @@ -32,21 +32,6 @@ class CursorTest < Test::Unit::TestCase assert_kind_of Numeric, explaination['nscanned'] end - def test_alive - batch = [] - 5000.times do |n| - batch << {:a => n} - end - @@coll.insert(batch) - cursor = @@coll.find - assert !cursor.alive? - cursor.next - assert cursor.alive? - cursor.close - assert !cursor.alive? - @@coll.remove - end - def test_count @@coll.remove