aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
diff options
context:
space:
mode:
authorDoug Barth <dougbarth@gmail.com>2008-10-14 15:30:46 -0500
committerMichael Koziarski <michael@koziarski.com>2008-10-17 18:09:38 +0200
commit47be090d37e803af502dc4cf97930184007c660d (patch)
tree6d8867792f54b6266ff135853332ef0f89b58e74 /activesupport/test/caching_test.rb
parent4b63c2700ffc5c646af0e728d4ec2fcb6770671b (diff)
downloadrails-47be090d37e803af502dc4cf97930184007c660d.tar.gz
rails-47be090d37e803af502dc4cf97930184007c660d.tar.bz2
rails-47be090d37e803af502dc4cf97930184007c660d.zip
Skip tests that depend on memcached if not running.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activesupport/test/caching_test.rb')
-rw-r--r--activesupport/test/caching_test.rb36
1 files changed, 19 insertions, 17 deletions
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index 88c6d6cca4..cc371b3a7b 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -146,26 +146,28 @@ class MemoryStoreTest < Test::Unit::TestCase
end
end
-class MemCacheStoreTest < Test::Unit::TestCase
- def setup
- @cache = ActiveSupport::Cache.lookup_store(:mem_cache_store)
- @cache.clear
- end
+uses_memcached 'memcached backed store' do
+ class MemCacheStoreTest < Test::Unit::TestCase
+ def setup
+ @cache = ActiveSupport::Cache.lookup_store(:mem_cache_store)
+ @cache.clear
+ end
- include CacheStoreBehavior
+ include CacheStoreBehavior
- def test_store_objects_should_be_immutable
- @cache.write('foo', 'bar')
- @cache.read('foo').gsub!(/.*/, 'baz')
- assert_equal 'bar', @cache.read('foo')
+ def test_store_objects_should_be_immutable
+ @cache.write('foo', 'bar')
+ @cache.read('foo').gsub!(/.*/, 'baz')
+ assert_equal 'bar', @cache.read('foo')
+ end
end
-end
-class CompressedMemCacheStore < Test::Unit::TestCase
- def setup
- @cache = ActiveSupport::Cache.lookup_store(:compressed_mem_cache_store)
- @cache.clear
- end
+ class CompressedMemCacheStore < Test::Unit::TestCase
+ def setup
+ @cache = ActiveSupport::Cache.lookup_store(:compressed_mem_cache_store)
+ @cache.clear
+ end
- include CacheStoreBehavior
+ include CacheStoreBehavior
+ end
end