mirror of
https://github.com/mastodon/mastodon.git
synced 2025-12-13 21:12:42 +00:00
Fix RSpec/LeakyLocalVariable cop
This commit is contained in:
parent
05b33bafb8
commit
dfc07f62dc
|
|
@ -73,8 +73,6 @@ RSpec.describe Mastodon::RedisConfiguration do
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'sentinel support' do |prefix = nil|
|
shared_examples 'sentinel support' do |prefix = nil|
|
||||||
prefix = prefix ? "#{prefix}_" : ''
|
|
||||||
|
|
||||||
context 'when configuring sentinel support' do
|
context 'when configuring sentinel support' do
|
||||||
around do |example|
|
around do |example|
|
||||||
ClimateControl.modify "#{prefix}REDIS_PASSWORD": 'testpass1', "#{prefix}REDIS_HOST": 'redis2.example.com', "#{prefix}REDIS_SENTINELS": '192.168.0.1:3000,192.168.0.2:4000', "#{prefix}REDIS_SENTINEL_MASTER": 'mainsentinel' do
|
ClimateControl.modify "#{prefix}REDIS_PASSWORD": 'testpass1', "#{prefix}REDIS_HOST": 'redis2.example.com', "#{prefix}REDIS_SENTINELS": '192.168.0.1:3000,192.168.0.2:4000', "#{prefix}REDIS_SENTINEL_MASTER": 'mainsentinel' do
|
||||||
|
|
@ -199,7 +197,7 @@ RSpec.describe Mastodon::RedisConfiguration do
|
||||||
|
|
||||||
it_behaves_like 'secondary configuration', 'SIDEKIQ'
|
it_behaves_like 'secondary configuration', 'SIDEKIQ'
|
||||||
it_behaves_like 'setting a different driver'
|
it_behaves_like 'setting a different driver'
|
||||||
it_behaves_like 'sentinel support', 'SIDEKIQ'
|
it_behaves_like 'sentinel support', 'SIDEKIQ_'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#cache' do
|
describe '#cache' do
|
||||||
|
|
@ -225,6 +223,6 @@ RSpec.describe Mastodon::RedisConfiguration do
|
||||||
|
|
||||||
it_behaves_like 'secondary configuration', 'CACHE'
|
it_behaves_like 'secondary configuration', 'CACHE'
|
||||||
it_behaves_like 'setting a different driver'
|
it_behaves_like 'setting a different driver'
|
||||||
it_behaves_like 'sentinel support', 'CACHE'
|
it_behaves_like 'sentinel support', 'CACHE_'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user