spec/client_spec.rb in redlock-2.0.2 vs spec/client_spec.rb in redlock-2.0.3

- old
+ new

@@ -57,9 +57,19 @@ expect(lock_info).to be_a(Hash) expect(resource_key).to_not be_lockable(lock_manager, ttl) lock_manager.unlock(lock_info) end + it 'accepts Configuration hashes' do + config = { url: "redis://#{redis1_host}:#{redis1_port}" } + _redlock = Redlock::Client.new([config]) + + lock_info = lock_manager.lock(resource_key, ttl) + expect(lock_info).to be_a(Hash) + expect(resource_key).to_not be_lockable(lock_manager, ttl) + lock_manager.unlock(lock_info) + end + it 'does not load scripts' do redis_client.call('SCRIPT', 'FLUSH') pool = ConnectionPool.new { RedisClient.new(url: "redis://#{redis1_host}:#{redis1_port}") } _redlock = Redlock::Client.new([pool])