ruby-changes:24590
From: suke <ko1@a...>
Date: Mon, 6 Aug 2012 19:21:26 +0900 (JST)
Subject: [ruby-changes:24590] suke:r36641 (trunk): * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale
suke 2012-08-06 19:21:12 +0900 (Mon, 06 Aug 2012) New Revision: 36641 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36641 Log: * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale to pass some assertion. Thanks to Hiroshi Shirosaki. [ruby-core:46873][Bug #6814] Modified files: trunk/ChangeLog trunk/test/win32ole/test_win32ole_variant.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36640) +++ ChangeLog (revision 36641) @@ -1,3 +1,9 @@ +Mon Aug 6 19:15:11 2012 Masaki Suketa <masaki.suketa@n...> + + * test/win32ole/test_win32ole_variant.rb: setting WIN32OLE.locale + to pass some assertion. Thanks to Hiroshi Shirosaki. + [ruby-core:46873][Bug #6814] + Mon Aug 6 15:54:50 2012 Shugo Maeda <shugo@r...> * internal.h, class.c, eval.c, insns.def: find the appropriate Index: test/win32ole/test_win32ole_variant.rb =================================================================== --- test/win32ole/test_win32ole_variant.rb (revision 36640) +++ test/win32ole/test_win32ole_variant.rb (revision 36641) @@ -7,7 +7,15 @@ 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') assert_instance_of(WIN32OLE_VARIANT, obj) @@ -390,18 +398,14 @@ 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 def test_create_vt_array -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/