test/unit/cursor_test.rb in mongo-1.6.4 vs test/unit/cursor_test.rb in mongo-1.7.0.rc0
- old
+ new
@@ -4,14 +4,17 @@
context "Cursor options" do
setup do
@logger = mock()
@logger.stubs(:debug)
@connection = stub(:class => Connection, :logger => @logger,
- :slave_ok? => false, :read_preference => :primary, :log_duration => false)
+ :slave_ok? => false, :read_preference => :primary, :log_duration => false,
+ :tag_sets => {}, :acceptable_latency => 10)
@db = stub(:name => "testing", :slave_ok? => false,
- :connection => @connection, :read_preference => :primary)
- @collection = stub(:db => @db, :name => "items", :read_preference => :primary)
+ :connection => @connection, :read_preference => :primary,
+ :tag_sets => {}, :acceptable_latency => 10)
+ @collection = stub(:db => @db, :name => "items", :read_preference => :primary,
+ :tag_sets => {}, :acceptable_latency => 10)
@cursor = Cursor.new(@collection)
end
should "set timeout" do
assert @cursor.timeout
@@ -101,12 +104,14 @@
context "Query fields" do
setup do
@logger = mock()
@logger.stubs(:debug)
@connection = stub(:class => Connection, :logger => @logger, :slave_ok? => false,
- :log_duration => false)
- @db = stub(:slave_ok? => true, :name => "testing", :connection => @connection)
- @collection = stub(:db => @db, :name => "items", :read_preference => :primary)
+ :log_duration => false, :tag_sets =>{}, :acceptable_latency => 10)
+ @db = stub(:slave_ok? => true, :name => "testing", :connection => @connection,
+ :tag_sets => {}, :acceptable_latency => 10)
+ @collection = stub(:db => @db, :name => "items", :read_preference => :primary,
+ :tag_sets => {}, :acceptable_latency => 10)
end
should "when an array should return a hash with each key" do
@cursor = Cursor.new(@collection, :fields => [:name, :age])
result = @cursor.fields