From 92a17a25cdcaacae023f5712a5ce88b84c679de2 Mon Sep 17 00:00:00 2001 From: Evan Weaver Date: Mon, 3 Aug 2009 12:12:13 -0700 Subject: [PATCH] Fix test bug. --- lib/memcached/memcached.rb | 3 +-- test/unit/memcached_test.rb | 2 +- test/unit/rails_test.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/memcached/memcached.rb b/lib/memcached/memcached.rb index 2cb1edd..d616db6 100644 --- a/lib/memcached/memcached.rb +++ b/lib/memcached/memcached.rb @@ -421,14 +421,13 @@ Please note that when pipelining is enabled, setter and deleter methods do not r def set_servers(servers) add_method = options[:use_udp] ? "memcached_server_add_udp_with_weight" : "memcached_server_add_with_weight" Array(servers).each_with_index do |server, index| - debugger if server.is_a?(String) and File.socket?(server) Lib.memcached_server_add_unix_socket_with_weight(@struct, server, options[:default_weight].to_i) elsif server.is_a?(String) and server =~ /^[\w\d\.-]+(:\d{1,5}){0,2}$/ host, port, weight = server.split(":") Lib.memcached_server_add_with_weight(@struct, host, port.to_i, (weight || options[:default_weight]).to_i) else - raise ArgumentError, "Servers must be either in the format 'host:port[:weight]' (e.g., 'localhost:11211' or 'localhost:11211:10') for a network server, or a valid pathname (e.g., /var/run/memcached) for a Unix domain socket." + raise ArgumentError, "Servers must be either in the format 'host:port[:weight]' (e.g., 'localhost:11211' or 'localhost:11211:10') for a network server, or a valid path to a Unix domain socket (e.g., /var/run/memcached)." end end # For inspect diff --git a/test/unit/memcached_test.rb b/test/unit/memcached_test.rb index 57b0144..fe88228 100644 --- a/test/unit/memcached_test.rb +++ b/test/unit/memcached_test.rb @@ -7,7 +7,7 @@ require 'benchmark' class MemcachedTest < Test::Unit::TestCase def setup - @servers = ['localhost:43042', 'localhost:43043',UNIX_SOCKET_NAME] + @servers = ['localhost:43042', 'localhost:43043', "#{UNIX_SOCKET_NAME}0"] # Maximum allowed prefix key size for :hash_with_prefix_key_key => false @prefix_key = 'prefix_key_' diff --git a/test/unit/rails_test.rb b/test/unit/rails_test.rb index 74776b7..70e906f 100644 --- a/test/unit/rails_test.rb +++ b/test/unit/rails_test.rb @@ -4,7 +4,7 @@ require "#{File.dirname(__FILE__)}/../test_helper" class RailsTest < Test::Unit::TestCase def setup - @servers = ['127.0.0.1:43042', '127.0.0.1:43043',UNIX_SOCKET_NAME] + @servers = ['127.0.0.1:43042', '127.0.0.1:43043', "#{UNIX_SOCKET_NAME}0"] @namespace = 'rails_test' @cache = Memcached::Rails.new(:servers => @servers, :namespace => @namespace) @value = OpenStruct.new(:a => 1, :b => 2, :c => GenericClass)