diff --git a/Rakefile b/Rakefile index 779a016..9d84155 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/lib/memcache.rb b/lib/memcache.rb index d16cda0..b6d3d99 100644 --- a/lib/memcache.rb +++ b/lib/memcache.rb @@ -1079,8 +1079,8 @@ def rbuf_fill end end - def setsockopt *args - @io.setsockopt *args + def setsockopt(*args) + @io.setsockopt(*args) end def gets diff --git a/test/test_mem_cache.rb b/test/test_mem_cache.rb index 840f619..eddf9b1 100644 --- a/test/test_mem_cache.rb +++ b/test/test_mem_cache.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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