spec/client_spec.rb in redlock-0.1.0 vs spec/client_spec.rb in redlock-0.1.1

- old
+ new

@@ -10,13 +10,14 @@ describe 'initialize' do it 'accepts both redis URLs and Redis objects' do servers = [ 'redis://localhost:6379', Redis.new(url: 'redis://someotherhost:6379') ] redlock = Redlock::Client.new(servers) - redlock_servers = redlock.instance_variable_get(:@servers) + redlock_servers = redlock.instance_variable_get(:@servers).map do |s| + s.instance_variable_get(:@redis).client.host + end - expect(redlock_servers.one? { |s| s.redis.client.host == 'localhost' }) - expect(redlock_servers.one? { |s| s.redis.client.port == 'someotherhost' }) + expect(redlock_servers).to match_array(%w{ localhost someotherhost }) end end describe 'lock' do context 'when lock is available' do