Keep the first string we fetch

Otherwise, it's possible for GC to run in between, and fail the test.
This commit is contained in:
Matthew Draper 2014-08-27 01:01:18 +09:30
parent 49b27dba28
commit d2d003e8f8
1 changed files with 1 additions and 1 deletions

View File

@ -939,8 +939,8 @@ class MemCacheStoreTest < ActiveSupport::TestCase
def test_read_should_return_a_different_object_id_each_time_it_is_called
@cache.write('foo', 'bar')
assert_not_equal @cache.read('foo').object_id, @cache.read('foo').object_id
value = @cache.read('foo')
assert_not_equal value.object_id, @cache.read('foo').object_id
value << 'bingo'
assert_not_equal value, @cache.read('foo')
end