Ensure Memcache local cache returns duplicated values [#2302 state:resolved]
This commit is contained in:
parent
61c471eebb
commit
6ef329d325
@ -45,7 +45,7 @@ def read(key, options = nil)
|
||||
elsif value.nil?
|
||||
value = super
|
||||
local_cache.write(key, value || NULL) if local_cache
|
||||
value
|
||||
value.duplicable? ? value.dup : value
|
||||
else
|
||||
# forcing the value to be immutable
|
||||
value.duplicable? ? value.dup : value
|
||||
|
@ -180,6 +180,15 @@ def test_store_objects_should_be_immutable
|
||||
end
|
||||
end
|
||||
|
||||
def test_stored_objects_should_not_be_frozen
|
||||
@cache.with_local_cache do
|
||||
@cache.write('foo', 'bar')
|
||||
end
|
||||
@cache.with_local_cache do
|
||||
assert !@cache.read('foo').frozen?
|
||||
end
|
||||
end
|
||||
|
||||
def test_write_should_return_true_on_success
|
||||
@cache.with_local_cache do
|
||||
result = @cache.write('foo', 'bar')
|
||||
|
Loading…
Reference in New Issue
Block a user