From 5da20f3905771368cd4babef6a1631498473d7d6 Mon Sep 17 00:00:00 2001 From: Luca Guidi Date: Mon, 20 Oct 2008 18:55:38 +0200 Subject: [PATCH] Make sure Rails.cache.write returns proper result when use MemCacheStore [#1239 state:resolved] --- activesupport/CHANGELOG | 2 ++ activesupport/lib/active_support/vendor.rb | 6 +----- activesupport/test/caching_test.rb | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 803f95d..369fe41 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* Make sure Rails.cache.write returns proper result when use MemCacheStore #1239 [Luca Guidi] + * TimeWithZone#freeze: preload instance variables so that we can actually freeze [Geoff Buesing] * Fix Brasilia timezone #1180 [Marcus Derencius, Kane] diff --git a/activesupport/lib/active_support/vendor.rb b/activesupport/lib/active_support/vendor.rb index 633eb2e..c0f59f1 100644 --- a/activesupport/lib/active_support/vendor.rb +++ b/activesupport/lib/active_support/vendor.rb @@ -13,11 +13,7 @@ rescue Gem::LoadError $:.unshift "#{File.dirname(__FILE__)}/vendor/xml-simple-1.0.11" end -begin - gem 'memcache-client', '~> 1.5.0' -rescue Gem::LoadError - $:.unshift "#{File.dirname(__FILE__)}/vendor/memcache-client-1.5.0" -end +$:.unshift "#{File.dirname(__FILE__)}/vendor/memcache-client-1.5.0" begin gem 'tzinfo', '~> 0.3.11' diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index cc371b3..e7dac4c 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -160,6 +160,12 @@ uses_memcached 'memcached backed store' do @cache.read('foo').gsub!(/.*/, 'baz') assert_equal 'bar', @cache.read('foo') end + + def test_write_should_return_true_on_success + result = @cache.write('foo', 'bar') + assert_equal 'bar', @cache.read('foo') # make sure 'foo' was written + assert result + end end class CompressedMemCacheStore < Test::Unit::TestCase -- 1.5.4.5