summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-30 08:36:47 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-30 08:36:47 +0000
commit3761e00f87802b7eea43f037991dfe826e3575ab (patch)
treea14c9fea3ffc2aebbf8135336580a9c3ccc3e7fe /test/win32ole
parent5edd7f07d822d45b55737efdf2fa24aea928e7d8 (diff)
* test/win32ole/test_win32ole_variant.rb: use skip method to skip the test.
* test/win32ole/test_win32ole_variant_outarg.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole_variant.rb11
-rw-r--r--test/win32ole/test_win32ole_variant_outarg.rb13
2 files changed, 9 insertions, 15 deletions
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index 2b34d27..70bfc8b 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -4,11 +4,6 @@ rescue LoadError
end
require "test/unit"
-$MSGS = []
-def add_skip_message(msg)
- $MSGS.push msg
-end
-
if defined?(WIN32OLE_VARIANT)
class TestWIN32OLE_VARIANT < Test::Unit::TestCase
@@ -260,7 +255,7 @@ if defined?(WIN32OLE_VARIANT)
assert_equal(-123456789012345, obj.value)
assert_equal(WIN32OLE::VARIANT::VT_I8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_new_with_i8_byref is skipped")
+ skip("WIN32OLE::VARIANT::VT_I8 is not available")
end
end
@@ -272,7 +267,7 @@ if defined?(WIN32OLE_VARIANT)
assert_equal(123456789012345, obj.value)
assert_equal(WIN32OLE::VARIANT::VT_UI8|WIN32OLE::VARIANT::VT_BYREF, obj.vartype)
else
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_s_new_with_ui8_byref is skipped.")
+ skip("WIN32OLE::VARIANT::VT_UI8 is not available")
end
end
@@ -398,7 +393,7 @@ if defined?(WIN32OLE_VARIANT)
begin
WIN32OLE.locale = 0x0411 # set locale Japanese
rescue WIN32OLERuntimeError
- STDERR.puts("\n#{__FILE__}:#{__LINE__}:#{self.class.name}.test_conversion_str2cy is skipped(Japanese locale is not installed)")
+ skip("Japanese locale is not installed")
end
if WIN32OLE.locale == 0x0411
obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
diff --git a/test/win32ole/test_win32ole_variant_outarg.rb b/test/win32ole/test_win32ole_variant_outarg.rb
index 1e4892f..560af10 100644
--- a/test/win32ole/test_win32ole_variant_outarg.rb
+++ b/test/win32ole/test_win32ole_variant_outarg.rb
@@ -23,16 +23,13 @@ def ado_csv_installed?
end
if defined?(WIN32OLE_VARIANT)
- dotest = ado_csv_installed?
- if !dotest
- STDERR.puts("\n#{__FILE__} skipped(ActiveX Data Object Library not found.)")
- end
- if dotest
class TestWIN32OLE_VARIANT_OUTARG < Test::Unit::TestCase
module ADO
end
CONNSTR="Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=.;"
def setup
+ return if !ado_csv_installed?
+
FileUtils.cp(File.dirname(__FILE__) + '/orig_data.csv', './data.csv')
@db = WIN32OLE.new('ADODB.Connection')
if !defined?(ADO::AdStateOpen)
@@ -43,6 +40,9 @@ if defined?(WIN32OLE_VARIANT)
end
def test_variant_ref_and_argv
+ if !ado_csv_installed?
+ skip("ActiveX Data Object Library not found")
+ end
sql = "INSERT INTO data.csv VALUES (5, 'E')"
@db.execute(sql, -1)
c = WIN32OLE::ARGV[1]
@@ -58,12 +58,11 @@ if defined?(WIN32OLE_VARIANT)
end
def teardown
+ return if !ado_csv_installed?
if @db && @db.state == ADO::AdStateOpen
@db.close
end
File.unlink("data.csv")
end
-
end
- end
end