air18n 0.1.35 → 0.1.36
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/air18n/chunk_cache.rb +6 -0
- data/lib/air18n/version.rb +1 -1
- data/spec/lib/air18n/chunk_cache_spec.rb +7 -3
- metadata +1 -1
data/lib/air18n/chunk_cache.rb
CHANGED
data/lib/air18n/version.rb
CHANGED
@@ -29,11 +29,15 @@ describe Air18n::ChunkCache do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'should work for values > 1M' do
|
32
|
+
key = "LARGE"
|
32
33
|
large_string = SecureRandom.urlsafe_base64(3000000)
|
33
|
-
Air18n::ChunkCache::set(@cache,
|
34
|
-
num_chunks, checksum = JSON.parse(@cache.read(Air18n::ChunkCache::CHECKSUM_CACHE_KEY %
|
34
|
+
Air18n::ChunkCache::set(@cache, key, large_string, 60)
|
35
|
+
num_chunks, checksum = JSON.parse(@cache.read(Air18n::ChunkCache::CHECKSUM_CACHE_KEY % key))
|
35
36
|
num_chunks.should == 5
|
36
|
-
Air18n::ChunkCache::get(@cache,
|
37
|
+
Air18n::ChunkCache::get(@cache, key).should == large_string
|
38
|
+
|
39
|
+
@cache.delete(Air18n::ChunkCache::CHUNK_CACHE_KEY % [key, 3])
|
40
|
+
Air18n::ChunkCache::get(@cache, key).should == nil
|
37
41
|
end
|
38
42
|
end
|
39
43
|
end
|