spec/client_spec.rb in nogara-redis_failover-1.0.5 vs spec/client_spec.rb in nogara-redis_failover-1.0.6

- old
+ new

@@ -1,9 +1,10 @@ require 'spec_helper' module RedisFailover Client::Redis = RedisStub + Client::Redis::Client = Redis::Client class ClientStub < Client def current_master @master end @@ -118,12 +119,14 @@ client.current_master.make_unavailable! client.del('foo') client.reconnected.should be_true end - it 'properly detects when a node has changed roles' do - client.current_master.change_role_to('slave') - expect { client.send(:master) }.to raise_error(InvalidNodeRoleError) + context 'with :verify_role true' do + it 'properly detects when a node has changed roles' do + client.current_master.change_role_to('slave') + expect { client.send(:master) }.to raise_error(InvalidNodeRoleError) + end end it 'raises error for unsupported operations' do expect { client.select }.to raise_error(UnsupportedOperationError) end