Sha256: 63694561bb6e056f40e174dcaebbcef041124e44bf1fb55289bae5f643c67775
Contents?: true
Size: 894 Bytes
Versions: 4
Compression:
Stored size: 894 Bytes
Contents
require File.expand_path('../../../spec_helper', __FILE__) describe RedisRing::Client::ShardConnectionPool do before(:each) do @metadata = FakeRingMetaData.new(5) 5.times do |n| @metadata.shards[n] = RedisRing::Client::ShardMetaData.new("host#{n}", 666 + n, :running) end @connection_pool = RedisRing::Client::ShardConnectionPool.new(@metadata, @password = nil, @db = 10) end it "should create a new connection when there was no shard connection before" do @connection_pool.expects(:new_connection).with("host1", 667, @db, @password).returns(:foo).once @connection_pool.connection(1).should == :foo end it "should cache connections" do @connection_pool.expects(:new_connection).with("host1", 667, @db, @password).returns(:foo).once @connection_pool.connection(1).should == :foo @connection_pool.connection(1).should == :foo end end
Version data entries
4 entries across 4 versions & 1 rubygems