Skip to content

Commit d1a979d

Browse files
authored
Remove unnecessary pooled specs (#708)
1 parent 77195a5 commit d1a979d

6 files changed

+24
-77
lines changed

spec/acceptance/stores/active_support_mem_cache_store_pooled_spec.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

spec/acceptance/stores/active_support_mem_cache_store_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
describe "ActiveSupport::Cache::MemCacheStore as a cache backend" do
99
before do
10-
Rack::Attack.cache.store = ActiveSupport::Cache::MemCacheStore.new
10+
Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0")
11+
ActiveSupport::Cache::MemCacheStore.new(pool: true)
12+
else
13+
ActiveSupport::Cache::MemCacheStore.new(pool_size: 2)
14+
end
1115
end
1216

1317
after do

spec/acceptance/stores/active_support_redis_cache_store_pooled_spec.rb

Lines changed: 0 additions & 29 deletions
This file was deleted.

spec/acceptance/stores/active_support_redis_cache_store_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
describe "ActiveSupport::Cache::RedisCacheStore as a cache backend" do
1414
before do
15-
Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new
15+
Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0")
16+
ActiveSupport::Cache::RedisCacheStore.new(pool: true)
17+
else
18+
ActiveSupport::Cache::RedisCacheStore.new(pool_size: 2)
19+
end
1620
end
1721

1822
after do

spec/acceptance/stores/connection_pool_dalli_client_spec.rb

Lines changed: 0 additions & 23 deletions
This file was deleted.

spec/acceptance/stores/dalli_client_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@
1717

1818
it_works_for_cache_backed_features(fetch_from_store: ->(key) { Rack::Attack.cache.store.fetch(key) })
1919
end
20+
21+
describe "ConnectionPool with Dalli::Client as a cache backend" do
22+
before do
23+
Rack::Attack.cache.store = ConnectionPool.new { Dalli::Client.new }
24+
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+
)
33+
end
2034
end

0 commit comments

Comments
 (0)