Skip to content

Commit 4c67647

Browse files
committed
Fix Dalli3
1 parent 5375791 commit 4c67647

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

spec/acceptance/stores/dalli_client_spec.rb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@
1818
it_works_for_cache_backed_features(fetch_from_store: ->(key) { Rack::Attack.cache.store.fetch(key) })
1919
end
2020

21-
describe "ConnectionPool with Dalli::Client as a cache backend" do
22-
before do
23-
Rack::Attack.cache.store = ConnectionPool.new { Dalli::Client.new }
21+
if defined?(::ConnectionPool)
22+
describe "ConnectionPool with Dalli::Client as a cache backend" do
23+
before do
24+
Rack::Attack.cache.store = ConnectionPool.new { Dalli::Client.new }
25+
end
26+
27+
after do
28+
Rack::Attack.cache.store.with { |client| client.flush_all }
29+
end
30+
31+
it_works_for_cache_backed_features(
32+
fetch_from_store: ->(key) { Rack::Attack.cache.store.with { |client| client.fetch(key) } }
33+
)
2434
end
25-
26-
after do
27-
Rack::Attack.cache.store.with { |client| client.flush_all }
28-
end
29-
30-
it_works_for_cache_backed_features(
31-
fetch_from_store: ->(key) { Rack::Attack.cache.store.with { |client| client.fetch(key) } }
32-
)
3335
end
3436
end

0 commit comments

Comments
 (0)