summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-29 21:19:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-30 08:45:01 +0900
commit45ba027d086a04e09ed6ad48c5ac78e61f1174c4 (patch)
tree2636ad66eb7245fe19534a03c5cc0fc6ea5aa6a8
parent9f648262f9372cbf21754a411a68e178f0fd8feb (diff)
Removed unused variables
-rw-r--r--test/csv/interface/test_read_write.rb1
-rw-r--r--test/net/imap/test_imap.rb3
-rw-r--r--test/net/smtp/test_smtp.rb2
-rw-r--r--test/rdoc/test_rdoc_servlet.rb2
-rw-r--r--test/ruby/test_bignum.rb2
-rw-r--r--test/ruby/test_file_exhaustive.rb1
-rw-r--r--test/ruby/test_numeric.rb1
-rw-r--r--test/ruby/test_process.rb1
-rw-r--r--test/ruby/test_system.rb4
-rw-r--r--test/ruby/test_thread_queue.rb2
-rw-r--r--test/socket/test_nonblock.rb4
-rw-r--r--test/test_open3.rb2
-rw-r--r--test/test_prime.rb2
-rw-r--r--test/win32ole/test_win32ole_event.rb5
14 files changed, 12 insertions, 20 deletions
diff --git a/test/csv/interface/test_read_write.rb b/test/csv/interface/test_read_write.rb
index 9ce3553d61b..877e5f355ea 100644
--- a/test/csv/interface/test_read_write.rb
+++ b/test/csv/interface/test_read_write.rb
@@ -6,7 +6,6 @@ class TestCSVInterfaceReadWrite < Test::Unit::TestCase
extend DifferentOFS
def test_filter
- rows = [[1, 2, 3], [4, 5]]
input = <<-CSV
1;2;3
4;5
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
index bdae8f28e43..b97be4ffb32 100644
--- a/test/net/imap/test_imap.rb
+++ b/test/net/imap/test_imap.rb
@@ -641,7 +641,7 @@ EOF
begin
imap = Net::IMAP.new(server_addr, :port => port)
- resp = imap.append("INBOX", mail)
+ imap.append("INBOX", mail)
assert_equal(1, requests.length)
assert_equal("RUBY0001 APPEND INBOX {#{mail.size}}\r\n", requests[0])
assert_equal(mail, received_mail)
@@ -664,7 +664,6 @@ Subject: hello
hello world
EOF
requests = []
- received_mail = nil
start_server do
sock = server.accept
begin
diff --git a/test/net/smtp/test_smtp.rb b/test/net/smtp/test_smtp.rb
index 23e1542d8f3..90c92e06f84 100644
--- a/test/net/smtp/test_smtp.rb
+++ b/test/net/smtp/test_smtp.rb
@@ -190,7 +190,7 @@ module Net
loop do
readable, = IO.select(servers.map(&:to_io))
readable.each do |r|
- sock, addr = r.accept_nonblock(exception: false)
+ sock, = r.accept_nonblock(exception: false)
next if sock == :wait_readable
return sock
end
diff --git a/test/rdoc/test_rdoc_servlet.rb b/test/rdoc/test_rdoc_servlet.rb
index 0a197a31b6d..a3d4246229b 100644
--- a/test/rdoc/test_rdoc_servlet.rb
+++ b/test/rdoc/test_rdoc_servlet.rb
@@ -224,7 +224,7 @@ class TestRDocServlet < RDoc::TestCase
generator = @s.generator_for store
- readme = store.add_file 'README.rdoc', parser: RDoc::Parser::Simple
+ store.add_file 'README.rdoc', parser: RDoc::Parser::Simple
@s.documentation_page store, generator, 'README_rdoc.html', @req, @res
diff --git a/test/ruby/test_bignum.rb b/test/ruby/test_bignum.rb
index 58d63a7c291..434c5befd96 100644
--- a/test/ruby/test_bignum.rb
+++ b/test/ruby/test_bignum.rb
@@ -10,7 +10,6 @@ class TestBignum < Test::Unit::TestCase
FIXNUM_MAX = RbConfig::LIMITS['FIXNUM_MAX']
BIGNUM_MIN = FIXNUM_MAX + 1
- b = BIGNUM_MIN
f = BIGNUM_MIN
n = 0
@@ -612,7 +611,6 @@ class TestBignum < Test::Unit::TestCase
return # GMP doesn't support interrupt during an operation.
end
time = Time.now
- start_flag = false
end_flag = false
num = (65536 ** 65536)
q = Queue.new
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 02890bb2a78..0612a618d6b 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -683,7 +683,6 @@ class TestFileExhaustive < Test::Unit::TestCase
def test_utime_symlinkfile
return unless symlinkfile
t = Time.local(2000)
- stat = File.lstat(symlinkfile)
assert_equal(1, File.utime(t, t, symlinkfile))
assert_equal(t, File.stat(regular_file).atime)
assert_equal(t, File.stat(regular_file).mtime)
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb
index f48bce54113..4e5404aa4ad 100644
--- a/test/ruby/test_numeric.rb
+++ b/test/ruby/test_numeric.rb
@@ -52,7 +52,6 @@ class TestNumeric < Test::Unit::TestCase
end.new
assert_equal(-1, -a)
- bug7688 = '[ruby-core:51389] [Bug #7688]'
a = Class.new(Numeric) do
def coerce(x); raise StandardError, "my error"; end
end.new
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index fb3f50a573d..02efc168c28 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -2362,7 +2362,6 @@ EOS
w.syswrite("exec failed\n")
end
q = Queue.new
- run = true
th1 = Thread.new { i = 0; i += 1 while q.empty?; i }
th2 = Thread.new { j = 0; j += 1 while q.empty? && Thread.pass.nil?; j }
sleep 0.5
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 477767905bf..31c9cd76542 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -188,7 +188,7 @@ class TestSystem < Test::Unit::TestCase
name = "\u{30c6 30b9 30c8}"
tmpfilename = "#{tmpdir}/#{name}.cmd"
message = /#{name}\.cmd/
- e = assert_raise_with_message(Errno::ENOENT, message) do
+ assert_raise_with_message(Errno::ENOENT, message) do
system(tmpfilename, exception: true)
end
open(tmpfilename, "w") {|f|
@@ -196,7 +196,7 @@ class TestSystem < Test::Unit::TestCase
f.puts "exit 127"
f.chmod(0755)
}
- e = assert_raise_with_message(RuntimeError, message) do
+ assert_raise_with_message(RuntimeError, message) do
system(tmpfilename, exception: true)
end
end
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb
index 8cebbbecb4a..4e34bb4f46a 100644
--- a/test/ruby/test_thread_queue.rb
+++ b/test/ruby/test_thread_queue.rb
@@ -474,7 +474,7 @@ class TestThreadQueue < Test::Unit::TestCase
prod_threads.each{|t|
begin
t.join
- rescue => e
+ rescue
end
}
end
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index 3f8d548c5e9..5d455934397 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -185,11 +185,11 @@ class TestSocketNonblock < Test::Unit::TestCase
def udp_pair
s1 = UDPSocket.new
s1.bind('127.0.0.1', 0)
- af, port1, host, addr1 = s1.addr
+ _, port1, _, addr1 = s1.addr
s2 = UDPSocket.new
s2.bind('127.0.0.1', 0)
- af, port2, host, addr2 = s2.addr
+ _, port2, _, addr2 = s2.addr
s1.connect(addr2, port2)
s2.connect(addr1, port1)
diff --git a/test/test_open3.rb b/test/test_open3.rb
index 6842ac8d8c4..848f70b07d8 100644
--- a/test/test_open3.rb
+++ b/test/test_open3.rb
@@ -77,7 +77,7 @@ class TestOpen3 < Test::Unit::TestCase
end
def test_env
- result = Open3.popen3({'A' => 'B', 'C' => 'D'}, RUBY, '-e' 'p ENV["A"]') do |i, out, err, thr|
+ Open3.popen3({'A' => 'B', 'C' => 'D'}, RUBY, '-e' 'p ENV["A"]') do |i, out, err, thr|
output = out.read
assert_equal("\"B\"\n", output)
end
diff --git a/test/test_prime.rb b/test/test_prime.rb
index 9c793daca05..3e5997fcdfb 100644
--- a/test/test_prime.rb
+++ b/test/test_prime.rb
@@ -74,7 +74,7 @@ class TestPrime < Test::Unit::TestCase
end
def test_new
- exception = assert_raise(NoMethodError) { Prime.new }
+ assert_raise(NoMethodError) { Prime.new }
end
def test_enumerator_succ
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index 3ab60c97974..0c819fccd72 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -25,9 +25,8 @@ end
def swbemsink_available?
available = false
if defined?(WIN32OLE)
- wmi = nil
begin
- wmi = WIN32OLE.new('WbemScripting.SWbemSink')
+ WIN32OLE.new('WbemScripting.SWbemSink')
available = true
rescue
end
@@ -422,7 +421,7 @@ if defined?(WIN32OLE_EVENT)
$SAFE=1
str = 'ConnectionEvents'
str.taint
- ev = WIN32OLE_EVENT.new(@db, str)
+ WIN32OLE_EVENT.new(@db, str)
}
exc = assert_raise(SecurityError) {
th.join