diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-05-19 19:37:36 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-05-19 19:37:36 -0300 |
commit | aa5512299041efb923cd582fd26009a72b9ec670 (patch) | |
tree | 4ba3cd70b4988293b99a89b72f0dbb177426a9f0 /activesupport/test | |
parent | 1cc44599397e061901cd59233397129625839a60 (diff) | |
parent | d8fffe7b23acce42bc3941d7bba47e07a66aed67 (diff) | |
download | rails-aa5512299041efb923cd582fd26009a72b9ec670.tar.gz rails-aa5512299041efb923cd582fd26009a72b9ec670.tar.bz2 rails-aa5512299041efb923cd582fd26009a72b9ec670.zip |
Merge commit 'rails/master'
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/caching_test.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index b845796fe5..ad19dcfd09 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -15,22 +15,28 @@ class CacheStoreSettingTest < ActiveSupport::TestCase end def test_mem_cache_fragment_cache_store + MemCache.expects(:new).with(%w[localhost], {}) store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost" assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) - assert_equal %w(localhost), store.addresses + end + + def test_mem_cache_fragment_cache_store_with_given_mem_cache + mem_cache = MemCache.new + MemCache.expects(:new).never + store = ActiveSupport::Cache.lookup_store :mem_cache_store, mem_cache + assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) end def test_mem_cache_fragment_cache_store_with_multiple_servers + MemCache.expects(:new).with(%w[localhost 192.168.1.1], {}) store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1' assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) - assert_equal %w(localhost 192.168.1.1), store.addresses end def test_mem_cache_fragment_cache_store_with_options + MemCache.expects(:new).with(%w[localhost 192.168.1.1], { :namespace => "foo" }) store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1', :namespace => 'foo' assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) - assert_equal %w(localhost 192.168.1.1), store.addresses - assert_equal 'foo', store.instance_variable_get('@data').instance_variable_get('@namespace') end def test_object_assigned_fragment_cache_store |