localmemcache_store 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/active_support/cache/localmemcache_store.rb +2 -4
- data/test/localmemcache_store_test.rb +13 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.8
|
@@ -8,10 +8,8 @@ module ActiveSupport::Cache
|
|
8
8
|
# This is especially useful if to run separated caches on one machine.
|
9
9
|
# * +:size_mb+: Size of the cache, defaults to +64+.
|
10
10
|
def initialize options = {}
|
11
|
-
options
|
12
|
-
|
13
|
-
:size_mb => 64
|
14
|
-
})
|
11
|
+
options[:size_mb] ||= 64
|
12
|
+
options[:namespace] ||= :lmc_store if options[:filename].blank?
|
15
13
|
@size_mb = options[:size_mb]
|
16
14
|
@cache = ExpiryCache.new options
|
17
15
|
end
|
@@ -96,4 +96,17 @@ class LocalmemcacheStoreTest < ActiveSupport::TestCase
|
|
96
96
|
test "status has usage" do
|
97
97
|
assert_not_nil @cache.status[:usage]
|
98
98
|
end
|
99
|
+
|
100
|
+
test "specifing a filename is not overridden by the standard namespace" do
|
101
|
+
ExpiryCache.expects(:new).with(Not(has_entries(:namespace => :lmc_store)))
|
102
|
+
cache = ActiveSupport::Cache.lookup_store(:localmemcache_store,
|
103
|
+
{ :filename => 'alternative_test_file' })
|
104
|
+
end
|
105
|
+
test "specifing a namespace is not overridden" do
|
106
|
+
mock = ExpiryCache.expects(:new)
|
107
|
+
mock.with(all_of(has_entries(:namespace => :alternative),
|
108
|
+
Not(has_entries(:namespace => :lmc_store))))
|
109
|
+
cache = ActiveSupport::Cache.lookup_store(:localmemcache_store,
|
110
|
+
{ :namespace => :alternative })
|
111
|
+
end
|
99
112
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localmemcache_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Florian D\xC3\xBCtsch (der_flo)"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-29 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|