2008-01-05 13:31:04 +00:00
|
|
|
require 'abstract_unit'
|
2008-01-03 21:05:12 +00:00
|
|
|
|
|
|
|
class CacheStoreSettingTest < Test::Unit::TestCase
|
|
|
|
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
|
|
|
|
|
|
|
|
def test_drb_fragment_cache_store
|
|
|
|
store = ActiveSupport::Cache.lookup_store :drb_store, "druby://localhost:9192"
|
|
|
|
assert_kind_of(ActiveSupport::Cache::DRbStore, store)
|
|
|
|
assert_equal "druby://localhost:9192", store.address
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_mem_cache_fragment_cache_store
|
|
|
|
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_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
|
|
|
|
end
|