Sha256: cac2d03836ac4a266e27493ceff844afbcec84c1bed0eddc1e1ee5b3ebad1bd9

Contents?: true

Size: 671 Bytes

Versions: 13

Compression:

Stored size: 671 Bytes

Contents

# -*- encoding: utf-8 -*-
require 'spec_helper'

module OnStomp::Failover::Pools
  describe RoundRobin, :failover => true do
    let(:clients) {
      [ '1', '2', '3']
    }
    let(:pool) {
      RoundRobin.new([]).tap do |p|
        p.stub(:clients => clients)
      end
    }
    
    describe ".next_client" do
      it "should return clients in order and cycle" do
        pool.next_client.should == '1'
        pool.next_client.should == '2'
        pool.next_client.should == '3'
        pool.next_client.should == '1'
        pool.next_client.should == '2'
        pool.next_client.should == '3'
        pool.next_client.should == '1'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onstomp-1.0.12 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.11 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.10 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.9 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.8 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.7 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.6 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.5 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.4 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.3 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.2 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.1 spec/onstomp/failover/pools/round_robin_spec.rb
onstomp-1.0.0 spec/onstomp/failover/pools/round_robin_spec.rb