summaryrefslogtreecommitdiff
path: root/test/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-06 10:21:12 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-06 10:21:12 +0000
commit906b2110d91a8e7c2319d8d4aa5fa797919fecf2 (patch)
tree1fb4e4f52948f9f2cbf3da6c354511a6f8eaaa16 /test/win32ole
parent9537e8ffe5b7a0e6a2a791e1886509dc98b6d3f9 (diff)
* test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
to pass some assertion. Thanks to Hiroshi Shirosaki. [ruby-core:46873][Bug #6814] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole')
-rw-r--r--test/win32ole/test_win32ole_variant.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index 70bfc8b..e6fddc9 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -7,6 +7,14 @@ require "test/unit"
if defined?(WIN32OLE_VARIANT)
class TestWIN32OLE_VARIANT < Test::Unit::TestCase
+ def setup
+ @orglocale = WIN32OLE.locale
+ WIN32OLE.locale = 0x0409 # set locale US-Eng
+ end
+
+ def teardown
+ WIN32OLE.locale = @orglocale
+ end
def test_s_new
obj = WIN32OLE_VARIANT.new('foo')
@@ -390,17 +398,13 @@ if defined?(WIN32OLE_VARIANT)
def test_conversion_str2cy
begin
- begin
- WIN32OLE.locale = 0x0411 # set locale Japanese
- rescue WIN32OLERuntimeError
- skip("Japanese locale is not installed")
- end
- if WIN32OLE.locale == 0x0411
- obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
- assert_equal("10000", obj.value)
- end
- ensure
- WIN32OLE.locale = WIN32OLE::LOCALE_SYSTEM_DEFAULT
+ WIN32OLE.locale = 0x0411 # set locale Japanese
+ rescue WIN32OLERuntimeError
+ skip("Japanese locale is not installed")
+ end
+ if WIN32OLE.locale == 0x0411
+ obj = WIN32OLE_VARIANT.new("\\10,000", WIN32OLE::VARIANT::VT_CY)
+ assert_equal("10000", obj.value)
end
end