diff --git a/spec/lib/redis/config_spec.rb b/spec/lib/redis/config_spec.rb index 79dc8b03d..296ede54b 100644 --- a/spec/lib/redis/config_spec.rb +++ b/spec/lib/redis/config_spec.rb @@ -42,6 +42,11 @@ describe Redis::Config do end end + after do + # ensuring the redis config is unset and won't affect other tests + described_class.instance_variable_set(:@config, nil) + end + it 'checks for app redis config' do expect(described_class.app.keys).to contain_exactly(:url, :password, :sentinels, :timeout, :reconnect_attempts, :ssl_params) expect(described_class.app[:url]).to eq("redis://#{redis_master_name}") @@ -59,6 +64,11 @@ describe Redis::Config do end end + after do + # ensuring the redis config is unset and won't affect other tests + described_class.instance_variable_set(:@config, nil) + end + it 'checks for app redis config and sentinel passwords will be empty' do expect(described_class.app.keys).to contain_exactly(:url, :password, :sentinels, :timeout, :reconnect_attempts, :ssl_params) expect(described_class.app[:url]).to eq("redis://#{redis_master_name}") @@ -77,6 +87,11 @@ describe Redis::Config do end end + after do + # ensuring the redis config is unset and won't affect other tests + described_class.instance_variable_set(:@config, nil) + end + it 'checks for app redis config and redis password is replaced in sentinel config' do expect(described_class.app.keys).to contain_exactly(:url, :password, :sentinels, :timeout, :reconnect_attempts, :ssl_params) expect(described_class.app[:url]).to eq("redis://#{redis_master_name}")