summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-16 04:38:06 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-16 04:38:06 +0000
commitd3f565ef2cf5ba65bd9303c686ea07232dac121c (patch)
treee345ebdfc42b95ffcbff849bde39b8bcbb10efa6
parent2df0301c72cfe9117d9fbdec0383a481dfe5e354 (diff)
modify test according to changing WIN32OLE.codepage behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb6
-rw-r--r--test/win32ole/test_win32ole.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/test/win32ole/test_folderitem2_invokeverb.rb b/test/win32ole/test_folderitem2_invokeverb.rb
index 853b05bed2..07cb9802d6 100644
--- a/test/win32ole/test_folderitem2_invokeverb.rb
+++ b/test/win32ole/test_folderitem2_invokeverb.rb
@@ -35,6 +35,11 @@ if defined?(WIN32OLE)
#
verbs = @fi2.verbs
verbs.extend(Enumerable)
+ @cp = WIN32OLE.codepage
+ begin
+ WIN32OLE.codepage = 932
+ rescue
+ end
@shortcut = verbs.collect{|verb|
verb.name
}.find {|name|
@@ -77,6 +82,7 @@ if defined?(WIN32OLE)
if @dummy_path
@fso.deleteFile(@dummy_path)
end
+ WIN32OLE.codepage = @cp
end
end
diff --git a/test/win32ole/test_win32ole.rb b/test/win32ole/test_win32ole.rb
index 5c31f1a07f..a79434fee2 100644
--- a/test/win32ole/test_win32ole.rb
+++ b/test/win32ole/test_win32ole.rb
@@ -271,12 +271,14 @@ if defined?(WIN32OLE)
# end
def test_s_codepage_set
+ cp = WIN32OLE.codepage
WIN32OLE.codepage = WIN32OLE::CP_UTF8
assert_equal(WIN32OLE::CP_UTF8, WIN32OLE.codepage)
- WIN32OLE.codepage = WIN32OLE::CP_ACP
+ WIN32OLE.codepage = cp
end
def test_s_codepage_changed
+ cp = WIN32OLE.codepage
fso = WIN32OLE.new("Scripting.FileSystemObject")
fname = fso.getTempName
begin
@@ -326,7 +328,7 @@ if defined?(WIN32OLE)
end
ensure
- WIN32OLE.codepage = WIN32OLE::CP_ACP
+ WIN32OLE.codepage = cp
if (File.exist?(fname))
File.unlink(fname)
end