aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/abstract_unit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/abstract_unit.rb')
-rw-r--r--activesupport/test/abstract_unit.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb
index a698beaa0e..9d8c252f86 100644
--- a/activesupport/test/abstract_unit.rb
+++ b/activesupport/test/abstract_unit.rb
@@ -26,6 +26,16 @@ unless defined? uses_mocha
end
end
+unless defined? uses_memcached
+ def uses_memcached(test_name)
+ require 'memcache'
+ MemCache.new('localhost').stats
+ yield
+ rescue MemCache::MemCacheError
+ $stderr.puts "Skipping #{test_name} tests. Start memcached and try again."
+ end
+end
+
# Show backtraces for deprecated behavior for quicker cleanup.
ActiveSupport::Deprecation.debug = true
@@ -40,4 +50,4 @@ def with_kcode(code)
else
yield
end
-end \ No newline at end of file
+end