aboutsummaryrefslogtreecommitdiffstats
path: root/ext/win32ole/tests/testWIN32OLE.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/win32ole/tests/testWIN32OLE.rb')
-rw-r--r--ext/win32ole/tests/testWIN32OLE.rb40
1 files changed, 39 insertions, 1 deletions
diff --git a/ext/win32ole/tests/testWIN32OLE.rb b/ext/win32ole/tests/testWIN32OLE.rb
index 7611da84ac..d0705093f3 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')
@@ -58,6 +58,44 @@ class TestWin32OLE < RUNIT::TestCase
assert_equal(-4160, CONST1::XlTop)
end
+ def test_s_codepage
+ assert_equal(WIN32OLE::CP_ACP, WIN32OLE.codepage)
+ end
+
+ def test_s_codepage_set
+ WIN32OLE.codepage = WIN32OLE::CP_UTF8
+ assert_equal(WIN32OLE::CP_UTF8, WIN32OLE.codepage)
+ WIN32OLE.codepage = WIN32OLE::CP_ACP
+ end
+
+ def test_const_CP_ACP
+ assert_equal(0, WIN32OLE::CP_ACP)
+ end
+
+ def test_const_CP_OEMCP
+ assert_equal(1, WIN32OLE::CP_OEMCP)
+ end
+
+ def test_const_CP_MACCP
+ assert_equal(2, WIN32OLE::CP_MACCP)
+ end
+
+ def test_const_CP_THREAD_ACP
+ assert_equal(3, WIN32OLE::CP_THREAD_ACP)
+ end
+
+ def test_const_CP_SYMBOL
+ assert_equal(42, WIN32OLE::CP_SYMBOL)
+ end
+
+ def test_const_CP_UTF7
+ assert_equal(65000, WIN32OLE::CP_UTF7)
+ end
+
+ def test_const_CP_UTF8
+ assert_equal(65001, WIN32OLE::CP_UTF8)
+ end
+
def test_get_win32ole_object
workbooks = @excel.Workbooks;
assert_instance_of(WIN32OLE, workbooks)