Sha256: 76e17722e63c280c303cdb1adb737ab82a2d784e0eebb5f77d41f6240df9ab15

Contents?: true

Size: 793 Bytes

Versions: 13

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

module RedisFailover
  describe NodeSnapshot do
    let(:snapshot) { NodeSnapshot.new(Node.new(:host => 'localhost', :port => '123')) }

    describe '#initialize' do
      it 'creates a new empty snapshot' do
        snapshot.available_count.should == 0
        snapshot.unavailable_count.should == 0
      end
    end

    describe '#viewable_by' do
      it 'updates the availability count' do
        snapshot.viewable_by('nm1', 0)
        snapshot.viewable_by('nm2', 0)
        snapshot.available_count.should == 2
      end
    end

    describe '#unviewable_by' do
      it 'updates the unavailability count' do
        snapshot.unviewable_by('nm1')
        snapshot.unviewable_by('nm2')
        snapshot.unavailable_count.should == 2
      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_snapshot_spec.rb
nogara-redis_failover-1.0.6 spec/node_snapshot_spec.rb
nogara-redis_failover-1.0.5 spec/node_snapshot_spec.rb
nogara-redis_failover-1.0.4 spec/node_snapshot_spec.rb
redis_failover-1.0.2 spec/node_snapshot_spec.rb
nogara-redis_failover-1.0.2 spec/node_snapshot_spec.rb
nogara-redis_failover-1.0.1 spec/node_snapshot_spec.rb
redis_failover-1.0.1 spec/node_snapshot_spec.rb
nogara-redis_failover-1.0.0 spec/node_snapshot_spec.rb
redis_failover-1.0.0 spec/node_snapshot_spec.rb
nogara-redis_failover-0.9.7.4 spec/node_snapshot_spec.rb
nogara-redis_failover-0.9.7.3 spec/node_snapshot_spec.rb
nogara-redis_failover-0.9.7.2 spec/node_snapshot_spec.rb