Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Perham <mperham@gmail.com>
  • Loading branch information
josh authored and mperham committed Sep 10, 2009
1 parent d84a544 commit 450e650
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Expand Up @@ -26,7 +26,9 @@ Rake::RDocTask.new do |rd|
rd.rdoc_dir = 'doc'
end

Rake::TestTask.new
Rake::TestTask.new do |t|
t.warning = true
end

task :default => :test

Expand Down
4 changes: 2 additions & 2 deletions lib/memcache.rb
Expand Up @@ -1079,8 +1079,8 @@ def rbuf_fill
end
end

def setsockopt *args
@io.setsockopt *args
def setsockopt(*args)
@io.setsockopt(*args)
end

def gets
Expand Down
22 changes: 11 additions & 11 deletions test/test_mem_cache.rb
Expand Up @@ -270,7 +270,7 @@ def test_cache_get_bad_state
@cache.cache_get(server, 'my_namespace:key')
end

assert_match /#{Regexp.quote 'No connection to server (NOT CONNECTED)'}/, e.message
assert_match(/#{Regexp.quote 'No connection to server (NOT CONNECTED)'}/, e.message)

assert !server.alive?
end
Expand Down Expand Up @@ -328,7 +328,7 @@ def test_cache_get_multi_bad_state
@cache.cache_get_multi server, 'my_namespace:key'
end

assert_match /#{Regexp.quote 'No connection to server (NOT CONNECTED)'}/, e.message
assert_match(/#{Regexp.quote 'No connection to server (NOT CONNECTED)'}/, e.message)

assert !server.alive?
end
Expand Down Expand Up @@ -564,7 +564,7 @@ def test_get_no_connection
@cache.get 'key'
end

assert_match /^No connection to server/, e.message
assert_match(/^No connection to server/, e.message)
end

def test_get_no_servers
Expand Down Expand Up @@ -853,7 +853,7 @@ def test_set_too_big
@cache.set 'key', 'v'
end

assert_match /object too large for cache/, e.message
assert_match(/object too large for cache/, e.message)
end

def test_prepend
Expand Down Expand Up @@ -1040,7 +1040,7 @@ def test_flush_all_failure
@cache.flush_all
end

assert_match /flush_all\r\n/, socket.written.string
assert_match(/flush_all\r\n/, socket.written.string)
end

def test_flush_all_for_real
Expand Down Expand Up @@ -1096,8 +1096,8 @@ def test_basic_threaded_operations_should_work
end

output = server.socket.written.string
assert_match /set my_namespace:test/, output
assert_match /test value/, output
assert_match(/set my_namespace:test/, output)
assert_match(/test value/, output)
end

def test_basic_unthreaded_operations_should_work
Expand All @@ -1119,8 +1119,8 @@ def test_basic_unthreaded_operations_should_work
end

output = server.socket.written.string
assert_match /set my_namespace:test/, output
assert_match /test value/, output
assert_match(/set my_namespace:test/, output)
assert_match(/test value/, output)
end

def util_setup_fake_server
Expand Down Expand Up @@ -1185,9 +1185,9 @@ def test_crazy_multithreaded_access
assert cache.decr('c', 5) > 14
assert_equal 11, cache.get('b')
d = cache.get('d', true)
assert_match /\Aab*\Z/, d
assert_match(/\Aab*\Z/, d)
e = cache.get('e', true)
assert_match /\Ay*x\Z/, e
assert_match(/\Ay*x\Z/, e)
end
end
end
Expand Down

0 comments on commit 450e650

Please sign in to comment.