summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 19:21:57 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 19:21:57 +0000
commit9e5f063138dbb6c47835b31fc2a86a82b15ab364 (patch)
treeedd4c77e13ba81287dc1cfbf5efd44498b398323 /test/win32ole
parente1c40b19672f4deef8d153dd2df81f9ecea4fd84 (diff)
* test/win32ole: get rid of warnings (unused variable).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_err_in_callback.rb4
-rw-r--r--test/win32ole/test_win32ole.rb4
-rw-r--r--test/win32ole/test_win32ole_event.rb6
-rw-r--r--test/win32ole/test_win32ole_method.rb8
-rw-r--r--test/win32ole/test_win32ole_variant.rb8
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb2
-rw-r--r--test/win32ole/test_word.rb1
7 files changed, 16 insertions, 17 deletions
diff --git a/test/win32ole/test_err_in_callback.rb b/test/win32ole/test_err_in_callback.rb
index d39ea12..cae6d49 100644
--- a/test/win32ole/test_err_in_callback.rb
+++ b/test/win32ole/test_err_in_callback.rb
@@ -29,7 +29,7 @@ if defined?(WIN32OLE)
def available_adodb?
begin
- db = WIN32OLE.new('ADODB.Connection')
+ WIN32OLE.new('ADODB.Connection')
rescue WIN32OLERuntimeError
return false
end
@@ -42,7 +42,7 @@ if defined?(WIN32OLE)
Dir.mktmpdir do |tmpdir|
logfile = File.join(tmpdir, "test_err_in_callback.log")
cmd = "#{@ruby} -v #{@iopt} #{@script} > #{logfile.gsub(%r(/), '\\')} 2>&1"
- result = system(cmd)
+ system(cmd)
str = ""
open(logfile) {|ifs|
str = ifs.read
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb
index 5b23737..71026d4 100644
--- a/test/win32ole/test_win32ole.rb
+++ b/test/win32ole/test_win32ole.rb
@@ -228,7 +228,7 @@ if defined?(WIN32OLE)
def test_invoke_hash_key_non_str_sym
fso = WIN32OLE.new('Scripting.FileSystemObject')
begin
- bfolder = fso.getFolder({1 => "."})
+ fso.getFolder({1 => "."})
assert(false)
rescue TypeError
assert(true)
@@ -270,7 +270,7 @@ if defined?(WIN32OLE)
def test_ole_query_interface
shell=WIN32OLE.new('Shell.Application')
assert_raise(ArgumentError) {
- shell2 = shell.ole_query_interface
+ shell.ole_query_interface
}
shell2 = shell.ole_query_interface('{A4C6892C-3BA9-11D2-9DEA-00C04FB16162}')
assert_instance_of(WIN32OLE, shell2)
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index 03e4dcd..8e3915e 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -52,7 +52,7 @@ if defined?(WIN32OLE_EVENT)
def test_s_new
assert_raise(TypeError) {
- ev = WIN32OLE_EVENT.new("A")
+ WIN32OLE_EVENT.new("A")
}
end
@@ -149,11 +149,11 @@ if defined?(WIN32OLE_EVENT)
def test_non_exist_event
assert_raise(RuntimeError) {
- ev = WIN32OLE_EVENT.new(@db, 'XXXX')
+ WIN32OLE_EVENT.new(@db, 'XXXX')
}
dict = WIN32OLE.new('Scripting.Dictionary')
assert_raise(RuntimeError) {
- ev = WIN32OLE_EVENT.new(dict)
+ WIN32OLE_EVENT.new(dict)
}
end
diff --git a/test/win32ole/test_win32ole_method.rb b/test/win32ole/test_win32ole_method.rb
index 2c24004..2a4e3d0 100644
--- a/test/win32ole/test_win32ole_method.rb
+++ b/test/win32ole/test_win32ole_method.rb
@@ -28,16 +28,16 @@ if defined?(WIN32OLE_METHOD)
WIN32OLE_METHOD.new(1, 2)
}
assert_raise(ArgumentError) {
- method = WIN32OLE_METHOD.new("foo")
+ WIN32OLE_METHOD.new("foo")
}
assert_raise(ArgumentError) {
- method = WIN32OLE_METHOD.new(ole_type)
+ WIN32OLE_METHOD.new(ole_type)
}
assert_raise(WIN32OLERuntimeError) {
- method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
+ WIN32OLE_METHOD.new(ole_type, "NonExistMethod")
}
assert_raise(TypeError) {
- method = WIN32OLE_METHOD.new(ole_type, 1)
+ WIN32OLE_METHOD.new(ole_type, 1)
}
method = WIN32OLE_METHOD.new(ole_type, "Open")
assert_instance_of(WIN32OLE_METHOD, method)
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index 8e701ef..73bcd75 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -38,7 +38,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_new_no_argument
ex = nil
begin
- obj = WIN32OLE_VARIANT.new
+ WIN32OLE_VARIANT.new
rescue ArgumentError
ex = $!
end
@@ -49,7 +49,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_new_one_argument
ex = nil
begin
- obj = WIN32OLE_VARIANT.new('foo')
+ WIN32OLE_VARIANT.new('foo')
rescue
ex = $!
end
@@ -343,7 +343,7 @@ if defined?(WIN32OLE_VARIANT)
def test_s_array_exc
assert_raise(TypeError) {
- obj = WIN32OLE_VARIANT.array(2, WIN32OLE::VARIANT::VT_I4)
+ WIN32OLE_VARIANT.array(2, WIN32OLE::VARIANT::VT_I4)
}
end
@@ -485,7 +485,7 @@ if defined?(WIN32OLE_VARIANT)
def test_create_vt_array_exc
exc = assert_raise(TypeError) {
- obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);
+ WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_ARRAY);
}
assert_match(/wrong argument type Fixnum \(expected Array\)/, exc.message)
end
diff --git a/test/win32ole/test_win32ole_variant_outarg.rb b/test/win32ole/test_win32ole_variant_outarg.rb
index 560af10..ffc8e06 100644
--- a/test/win32ole/test_win32ole_variant_outarg.rb
+++ b/test/win32ole/test_win32ole_variant_outarg.rb
@@ -46,7 +46,7 @@ if defined?(WIN32OLE_VARIANT)
sql = "INSERT INTO data.csv VALUES (5, 'E')"
@db.execute(sql, -1)
c = WIN32OLE::ARGV[1]
- assert_equal(1, WIN32OLE::ARGV[1])
+ assert_equal(1, c)
obj = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_VARIANT|WIN32OLE::VARIANT::VT_BYREF)
assert_equal(nil, obj.value)
@db.execute(sql , obj)
diff --git a/test/win32ole/test_word.rb b/test/win32ole/test_word.rb
index e2ca6d4..acfa214 100644
--- a/test/win32ole/test_word.rb
+++ b/test/win32ole/test_word.rb
@@ -26,7 +26,6 @@ def word_installed?
end
if defined?(WIN32OLE)
- w = nil
dotest = word_installed?
if !dotest
STDERR.puts("\n#{__FILE__} skipped(Microsoft Word not found.)")