From 86a9c212c09546a93b72970adf07ce9fba0d8d8e Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 15 Oct 2007 01:47:35 +0000 Subject: Skip memcache tests unless it's installed git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7893 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../test/controller/fragment_store_setting_test.rb | 18 ++++++++++-------- .../test/controller/session/mem_cache_store_test.rb | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/fragment_store_setting_test.rb b/actionpack/test/controller/fragment_store_setting_test.rb index cb872f6505..3df6fd0be2 100644 --- a/actionpack/test/controller/fragment_store_setting_test.rb +++ b/actionpack/test/controller/fragment_store_setting_test.rb @@ -24,14 +24,16 @@ class FragmentCacheStoreSettingTest < Test::Unit::TestCase ) assert_equal "druby://localhost:9192", ActionController::Base.fragment_cache_store.address end - - def test_mem_cache_fragment_cache_store - ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost" - assert_kind_of( - ActionController::Caching::Fragments::MemCacheStore, - ActionController::Base.fragment_cache_store - ) - assert_equal %w(localhost), ActionController::Base.fragment_cache_store.addresses + + if defined? CGI::Session::MemCacheStore + def test_mem_cache_fragment_cache_store + ActionController::Base.fragment_cache_store = :mem_cache_store, "localhost" + assert_kind_of( + ActionController::Caching::Fragments::MemCacheStore, + ActionController::Base.fragment_cache_store + ) + assert_equal %w(localhost), ActionController::Base.fragment_cache_store.addresses + end end def test_object_assigned_fragment_cache_store diff --git a/actionpack/test/controller/session/mem_cache_store_test.rb b/actionpack/test/controller/session/mem_cache_store_test.rb index 1fd2d0cd75..3afb7a8ea9 100644 --- a/actionpack/test/controller/session/mem_cache_store_test.rb +++ b/actionpack/test/controller/session/mem_cache_store_test.rb @@ -11,6 +11,7 @@ end uses_mocha 'MemCacheStore tests' do +if defined? MemCache::MemCacheError class MemCacheStoreTest < Test::Unit::TestCase SESSION_KEY_RE = /^session:[0-9a-z]+/ @@ -177,4 +178,5 @@ class MemCacheStoreTest < Test::Unit::TestCase end end +end # defined? MemCache end # uses_mocha -- cgit v1.2.3