From 1da7630c271624ff4820b671591ceba5e7328254 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Mon, 21 Jun 2010 18:19:12 +0200 Subject: [PATCH] preventing memcached initialization errors with default servers list --- .../lib/active_support/cache/mem_cache_store.rb | 2 +- activesupport/test/abstract_unit.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index e3a2688..3c46ae5 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -35,7 +35,7 @@ module ActiveSupport def self.build_mem_cache(*addresses) addresses = addresses.flatten options = addresses.extract_options! - addresses = ["localhost"] if addresses.empty? + addresses = ["localhost:11211"] if addresses.empty? MemCache.new(addresses, options) end diff --git a/activesupport/test/abstract_unit.rb b/activesupport/test/abstract_unit.rb index dd84860..1214b97 100644 --- a/activesupport/test/abstract_unit.rb +++ b/activesupport/test/abstract_unit.rb @@ -23,7 +23,7 @@ require 'active_support/ruby/shim' if RUBY_VERSION < '1.8.7' def uses_memcached(test_name) require 'memcache' begin - MemCache.new('localhost').stats + MemCache.new('localhost:11211').stats yield rescue MemCache::MemCacheError $stderr.puts "Skipping #{test_name} tests. Start memcached and try again." -- 1.7.1