summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-15 13:43:32 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-15 13:43:32 +0000
commit9f6d8980ff21139fa45ae58ce67a8ece8cb33563 (patch)
tree98bc8c7061829037211e0fde8f6c0faf57d11769 /ext
parent6a63e942ba20b6a2bb4d7fb3ef784cc89f0e5ae7 (diff)
* ext/win32ole/tests/testWIN32OLE.rb: add test for WIN32OLE.codepage=
* ext/win32ole/tests/testOLETYPELIB.rb: correct expected message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32ole/tests/testOLETYPELIB.rb2
-rw-r--r--ext/win32ole/tests/testWIN32OLE.rb18
2 files changed, 18 insertions, 2 deletions
diff --git a/ext/win32ole/tests/testOLETYPELIB.rb b/ext/win32ole/tests/testOLETYPELIB.rb
index 9248ecfefb..ceb246930f 100644
--- a/ext/win32ole/tests/testOLETYPELIB.rb
+++ b/ext/win32ole/tests/testOLETYPELIB.rb
@@ -21,7 +21,7 @@ class TestOLETYPELIB < Test::Unit::TestCase
msg = $!.to_s
exception_occured = true
end
- assert_equal("Not found type library `NON EXIST TYPELIB`", msg)
+ assert_equal("not found type library `NON EXIST TYPELIB`", msg)
assert(exception_occured)
end
diff --git a/ext/win32ole/tests/testWIN32OLE.rb b/ext/win32ole/tests/testWIN32OLE.rb
index 379eca315d..ca966f0cce 100644
--- a/ext/win32ole/tests/testWIN32OLE.rb
+++ b/ext/win32ole/tests/testWIN32OLE.rb
@@ -41,7 +41,7 @@ class TestWin32OLE < RUNIT::TestCase
exc = assert_exception(WIN32OLERuntimeError) {
WIN32OLE.new("{000}")
}
- assert_match(/Unknown OLE server: `\{000\}'/, exc.message)
+ assert_match(/unknown OLE server: `\{000\}'/, exc.message)
end
def test_s_connect
excel2 = WIN32OLE.connect('Excel.Application')
@@ -96,6 +96,22 @@ class TestWin32OLE < RUNIT::TestCase
assert_equal(65001, WIN32OLE::CP_UTF8)
end
+ def test_s_codepage_changed
+ book = @excel.workbooks.add
+ sheet = book.worksheets(1)
+ begin
+ WIN32OLE.codepage = WIN32OLE::CP_UTF8
+ sheet.range("A1").value = [0x3042].pack("U*")
+ val = sheet.range("A1").value
+ assert_equal("\343\201\202", val)
+ WIN32OLE.codepage = WIN32OLE::CP_ACP
+ val = sheet.range("A1").value
+ assert_equal("\202\240", val)
+ ensure
+ book.saved = true
+ end
+ end
+
def test_get_win32ole_object
workbooks = @excel.Workbooks;
assert_instance_of(WIN32OLE, workbooks)