Methods
T
Instance Public methods
test_file_fragment_cache_store()
# File activesupport/test/caching_test.rb, line 129
def test_file_fragment_cache_store
  store = ActiveSupport::Cache.lookup_store :file_store, "/path/to/cache/directory"
  assert_kind_of(ActiveSupport::Cache::FileStore, store)
  assert_equal "/path/to/cache/directory", store.cache_path
end
test_mem_cache_fragment_cache_store()
# File activesupport/test/caching_test.rb, line 135
def test_mem_cache_fragment_cache_store
  assert_called_with(Dalli::Client, :new, [%w[localhost], {}]) do
    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost"
    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
  end
end
test_mem_cache_fragment_cache_store_with_given_mem_cache()
# File activesupport/test/caching_test.rb, line 142
def test_mem_cache_fragment_cache_store_with_given_mem_cache
  mem_cache = Dalli::Client.new
  assert_not_called(Dalli::Client, :new) do
    store = ActiveSupport::Cache.lookup_store :mem_cache_store, mem_cache
    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
  end
end
test_mem_cache_fragment_cache_store_with_multiple_servers()
# File activesupport/test/caching_test.rb, line 159
def test_mem_cache_fragment_cache_store_with_multiple_servers
  assert_called_with(Dalli::Client, :new, [%w[localhost 192.168.1.1], {}]) do
    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1'
    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
  end
end
test_mem_cache_fragment_cache_store_with_not_dalli_client()
# File activesupport/test/caching_test.rb, line 150
def test_mem_cache_fragment_cache_store_with_not_dalli_client
  assert_not_called(Dalli::Client, :new) do
    memcache = Object.new
    assert_raises(ArgumentError) do
      ActiveSupport::Cache.lookup_store :mem_cache_store, memcache
    end
  end
end
test_mem_cache_fragment_cache_store_with_options()
# File activesupport/test/caching_test.rb, line 166
def test_mem_cache_fragment_cache_store_with_options
  assert_called_with(Dalli::Client, :new, [%w[localhost 192.168.1.1], { :timeout => 10 }]) do
    store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1', :namespace => 'foo', :timeout => 10
    assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)
    assert_equal 'foo', store.options[:namespace]
  end
end
test_object_assigned_fragment_cache_store()
# File activesupport/test/caching_test.rb, line 174
def test_object_assigned_fragment_cache_store
  store = ActiveSupport::Cache.lookup_store ActiveSupport::Cache::FileStore.new("/path/to/cache/directory")
  assert_kind_of(ActiveSupport::Cache::FileStore, store)
  assert_equal "/path/to/cache/directory", store.cache_path
end