Sha256: 718ef57c006af08ba22d08b1435f3ce4ed7c1a2b620a954b49c356cc9d4345e3

Contents?: true

Size: 576 Bytes

Versions: 13

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'

module RedisFailover
  describe NodeStrategy do

    describe '.for' do
      it 'creates a new majority strategy instance' do
        s = NodeStrategy.for('majority')
        s.should be_a RedisFailover::NodeStrategy::Majority
      end

      it 'creates a new consensus strategy instance' do
        s = NodeStrategy.for('consensus')
        s.should be_a RedisFailover::NodeStrategy::Consensus
      end

      it 'rejects unknown strategies' do
        expect { NodeStrategy.for('foobar') }.to raise_error(RuntimeError)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
spbtv_redis_failover-1.0.2.1 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.6 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.5 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.4 spec/node_strategy_spec.rb
redis_failover-1.0.2 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.2 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.1 spec/node_strategy_spec.rb
redis_failover-1.0.1 spec/node_strategy_spec.rb
nogara-redis_failover-1.0.0 spec/node_strategy_spec.rb
redis_failover-1.0.0 spec/node_strategy_spec.rb
nogara-redis_failover-0.9.7.4 spec/node_strategy_spec.rb
nogara-redis_failover-0.9.7.3 spec/node_strategy_spec.rb
nogara-redis_failover-0.9.7.2 spec/node_strategy_spec.rb