test: fix some warnings found with "ruby -w -c"
authorEric Wong <normalperson@yhbt.net>
Wed, 31 Oct 2012 19:20:53 +0000 (31 19:20 +0000)
committerEric Wong <normalperson@yhbt.net>
Wed, 31 Oct 2012 19:20:53 +0000 (31 19:20 +0000)
Less noise should be better.

test/socket_test.rb
test/test_fresh.rb

index 7818506..d0aff32 100644 (file)
@@ -95,7 +95,7 @@ module SocketTest
   def test_read_in_full
     sock = MogileFS::Socket.tcp(@host, @port)
     accepted = @srv.accept
-    thr = Thread.new do
+    Thread.new do
       accepted.write "HELLO"
       sleep 0.1
       accepted.write " "
index a87ebd5..7585ab0 100644 (file)
@@ -44,7 +44,7 @@ class TestMogFresh < Test::Unit::TestCase
       opts[:content_md5] = [ Digest::MD5.digest(content) ].pack('m').rstrip
       opts[:class] = "check"
     end
-    rv = @client.new_file(key, opts) do |http_file|
+    @client.new_file(key, opts) do |http_file|
       http_file << content
     end
 
@@ -106,7 +106,7 @@ class TestMogFresh < Test::Unit::TestCase
     line = buf.split(/\r?\n/).grep(/\screate_open\s/)[0]
     assert_equal 0, buf.split(/\r?\n/).grep(/\screate_close\s/).size
     assert_equal 0, buf.split(/\r?\n/).grep(/\sfarewell\s/).size
-    assert_match /\bhello=world\b/, line
+    assert_match(/\bhello=world\b/, line)
     assert_equal 1, io.write('.')
     assert_nil io.close
 
@@ -114,6 +114,6 @@ class TestMogFresh < Test::Unit::TestCase
     buf = ""
     buf << socket.readpartial(666) until buf =~ /\.\r?\n\z/
     line = buf.split(/\r?\n/).grep(/\screate_close\s/)[0]
-    assert_match /\bfarewell=goodnight\b/, line
+    assert_match(/\bfarewell=goodnight\b/, line)
   end
 end