minor: fix prev commit

This commit is contained in:
Kyle Banker 2010-11-04 17:35:58 -04:00
parent c984af4ff0
commit 8125e26c4d
2 changed files with 4 additions and 3 deletions

View File

@ -169,7 +169,7 @@ module Mongo
batch_size = opts.delete(:batch_size)
timeout = (opts.delete(:timeout) == false) ? false : true
if !timeout
if timeout == false && !block_given?
raise ArgumentError, "Collection#find must be invoked with a block when timeout is disabled."
end

View File

@ -167,8 +167,9 @@ class CursorTest < Test::Unit::TestCase
cursor = Cursor.new(@@coll, :timeout => false)
assert_equal false, cursor.timeout
cursor = @@coll.find({}, :timeout => false)
assert_equal false, cursor.timeout
@@coll.find({}, :timeout => false) do |cursor|
assert_equal false, cursor.timeout
end
end
def test_timeout