Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

describe "ActiveSupport::Cache::MemCacheStore as a cache backend" do
before do
Rack::Attack.cache.store = ActiveSupport::Cache::MemCacheStore.new
Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0")
ActiveSupport::Cache::MemCacheStore.new(pool: true)
else
ActiveSupport::Cache::MemCacheStore.new(pool_size: 2)
end
end

after do
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

describe "ActiveSupport::Cache::RedisCacheStore as a cache backend" do
before do
Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new
Rack::Attack.cache.store = if ActiveSupport.gem_version >= Gem::Version.new("7.2.0")
ActiveSupport::Cache::RedisCacheStore.new(pool: true)
else
ActiveSupport::Cache::RedisCacheStore.new(pool_size: 2)
end
end

after do
Expand Down
23 changes: 0 additions & 23 deletions spec/acceptance/stores/connection_pool_dalli_client_spec.rb

This file was deleted.

14 changes: 14 additions & 0 deletions spec/acceptance/stores/dalli_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,18 @@

it_works_for_cache_backed_features(fetch_from_store: ->(key) { Rack::Attack.cache.store.fetch(key) })
end

describe "ConnectionPool with Dalli::Client as a cache backend" do
before do
Rack::Attack.cache.store = ConnectionPool.new { Dalli::Client.new }
end

after do
Rack::Attack.cache.store.with { |client| client.flush_all }
end

it_works_for_cache_backed_features(
fetch_from_store: ->(key) { Rack::Attack.cache.store.with { |client| client.fetch(key) } }
)
end
end