From a034eb2655d32edccd63d3fb0384b149518ad9db Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 7 Nov 2011 17:44:51 -0500 Subject: [PATCH] minor: test update --- test/load/thin/load.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/load/thin/load.rb b/test/load/thin/load.rb index a29296e..b5dc726 100644 --- a/test/load/thin/load.rb +++ b/test/load/thin/load.rb @@ -1,7 +1,7 @@ require File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'mongo') require 'logger' -$con = Mongo::Connection.new +$con = Mongo::ReplSetConnection.new(['localhost', 30000], ['localhost', 30001], :read => :secondary, :refresh_mode => :async, :refresh_interval => 30) $db = $con['foo'] class Load < Sinatra::Base @@ -13,12 +13,9 @@ class Load < Sinatra::Base end get '/' do - 3.times do |n| - if (v=$db.eval("1 + #{n}")) != 1 + n - STDERR << "#{1 + n} expected but got #{v}" - raise StandardError, "#{1 + n} expected but got #{v}" - end - end + $db['test'].insert({:a => rand(1000)}) + $db['test'].find({:a => {'$gt' => rand(2)}}, :read => :secondary).limit(2).to_a + "ok" end end