multi_cache-rails 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/multi_cache/rails.rb +1 -1
- data/lib/multi_cache/version.rb +1 -1
- data/spec/rails_spec.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c39eda7580775e4c1b15bdbf8d19f9b441ce820
|
4
|
+
data.tar.gz: d38e758e5e143cedead4500f52d590d922926d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8c595a9fa3090a9b146ab39922df40f43ec97ee37b5c97c3294e776049fb6a1138e519bc0851b98bdf9fd48b49194c155917131f417c72400367260df5d764d
|
7
|
+
data.tar.gz: 370fbc8e4796aac3eab40dae452c2f7e2145aa7d4f08721c05c65dca445b4698107c6990da4a401b1482cfdfad6a55ff663f07cd6810069ab2561841ab944746
|
data/lib/multi_cache/rails.rb
CHANGED
data/lib/multi_cache/version.rb
CHANGED
data/spec/rails_spec.rb
CHANGED
@@ -5,12 +5,23 @@ module Rails
|
|
5
5
|
let!(:set2) { Rails.cache = { name: :secondary, cache: 'cache_object2' } }
|
6
6
|
let!(:set3) { Rails.cache = { name: :tertiary, cache: 'cache_object3' } }
|
7
7
|
|
8
|
-
it '
|
8
|
+
it 'returns cache object' do
|
9
9
|
expect(Rails.cache).to eq 'cache_object1'
|
10
10
|
expect(Rails.cache(:default)).to eq 'cache_object1'
|
11
11
|
expect(Rails.cache(:secondary)).to eq 'cache_object2'
|
12
12
|
expect(Rails.cache(:tertiary)).to eq 'cache_object3'
|
13
13
|
expect(Rails.cache(:nothing)).to eq 'cache_object1'
|
14
14
|
end
|
15
|
+
|
16
|
+
context 'only set RAILS_CACHE' do
|
17
|
+
before do
|
18
|
+
silence_warnings { Object.const_set 'RAILS_CACHE', 'cache_object1' }
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'returns cache object' do
|
22
|
+
expect(Rails.cache).to eq 'cache_object1'
|
23
|
+
expect(Rails.cache(:nothing)).to eq 'cache_object1'
|
24
|
+
end
|
25
|
+
end
|
15
26
|
end
|
16
27
|
end
|