minor: fix default timeout option

This commit is contained in:
Kyle Banker 2010-07-16 14:04:13 -04:00
parent b1cf0d1e13
commit c9573f05ad
3 changed files with 10 additions and 1 deletions

View File

@ -45,7 +45,7 @@ module Mongo
@order = options[:order]
@hint = options[:hint]
@snapshot = options[:snapshot]
@timeout = options[:timeout] || false
@timeout = options[:timeout] || true
@explain = options[:explain]
@socket = options[:socket]
@tailable = options[:tailable] || false

View File

@ -297,6 +297,11 @@ class TestCollection < Test::Unit::TestCase
end
end
def test_defualt_timeout
cursor = @@test.find
assert_equal true, cursor.timeout
end
def test_fields_as_hash
@@test.save(:a => 1, :b => 1, :c => 1)

View File

@ -9,6 +9,10 @@ class CursorTest < Test::Unit::TestCase
@cursor = Cursor.new(@collection)
end
should "set timeout" do
assert_equal true, @cursor.timeout
end
should "set selector" do
assert @cursor.selector == {}