From 834a5a9c7eb9ea43af067b8b2b3af0249e4fd461 Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Mon, 27 Aug 2012 09:46:35 +0530 Subject: Let's run action pack tests with Dalli There is no memcache gem left in repo. --- actionpack/test/dispatch/session/mem_cache_store_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack') diff --git a/actionpack/test/dispatch/session/mem_cache_store_test.rb b/actionpack/test/dispatch/session/mem_cache_store_test.rb index 03234612ab..7e9e41c29a 100644 --- a/actionpack/test/dispatch/session/mem_cache_store_test.rb +++ b/actionpack/test/dispatch/session/mem_cache_store_test.rb @@ -34,9 +34,9 @@ class MemCacheStoreTest < ActionDispatch::IntegrationTest end begin - require 'memcache' - memcache = MemCache.new('localhost:11211') - memcache.set('ping', '') + require 'dalli' + ss = Dalli::Client.new('localhost:11211').stats + raise Dalli::DalliError unless ss['localhost:11211'] def test_setting_and_getting_session_value with_test_route_set do @@ -165,7 +165,7 @@ class MemCacheStoreTest < ActionDispatch::IntegrationTest assert_not_equal session_id, cookies['_session_id'] end end - rescue LoadError, RuntimeError + rescue LoadError, RuntimeError, Dalli::DalliError $stderr.puts "Skipping MemCacheStoreTest tests. Start memcached and try again." end -- cgit v1.2.3 From 1f5f5cfc363c82f38f0e1b171d1f798c6d5b4402 Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Mon, 27 Aug 2012 09:46:52 +0530 Subject: More fixes for action pack tests with Dalli. --- .../lib/action_dispatch/middleware/session/mem_cache_store.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb b/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb index 38a737cd2b..14af7eef68 100644 --- a/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb @@ -1,15 +1,15 @@ require 'action_dispatch/middleware/session/abstract_store' -require 'rack/session/memcache' +require 'rack/session/dalli' module ActionDispatch module Session - class MemCacheStore < Rack::Session::Memcache + class MemCacheStore < Rack::Session::Dalli include Compatibility include StaleSessionCheck include SessionObject def initialize(app, options = {}) - require 'memcache' + require 'dalli' options[:expire_after] ||= options[:expires] super end -- cgit v1.2.3