mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
2df0301c72
commit
d3f565ef2c
2 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue