minor: fix prev commit
This commit is contained in:
parent
c984af4ff0
commit
8125e26c4d
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue