Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (26 sloc) 0.793 kB
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
Jump to Line
Something went wrong with that request. Please try again.