diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-20 00:37:35 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-20 00:37:35 +0000 |
commit | b44bd4c6d35a98e4e9fb2e49a7d6b600cf140baa (patch) | |
tree | 2b64a74e27cb40d804bd1f42de89e220b922f139 /ext | |
parent | 59835fe8650136364766d1a313fadab4f42c6b63 (diff) | |
download | ruby-b44bd4c6d35a98e4e9fb2e49a7d6b600cf140baa.tar.gz |
move all test from ext/win32ole/tests test/win32ole
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/win32ole/tests/oleserver.rb | 10 | ||||
-rw-r--r-- | ext/win32ole/tests/testWIN32OLE.rb | 100 | ||||
-rw-r--r-- | ext/win32ole/tests/testall.rb | 4 |
3 files changed, 0 insertions, 114 deletions
diff --git a/ext/win32ole/tests/oleserver.rb b/ext/win32ole/tests/oleserver.rb deleted file mode 100644 index bf721373e5..0000000000 --- a/ext/win32ole/tests/oleserver.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'win32ole' -def oletypelib_name(pat) - WIN32OLE_TYPE.typelibs.each do |lib| - return lib if pat =~ lib - end -end -module OLESERVER - MS_EXCEL_TYPELIB = oletypelib_name(/^Microsoft Excel .* Object Library$/) - MS_XML_TYPELIB = oletypelib_name(/^Microsoft XML/) -end diff --git a/ext/win32ole/tests/testWIN32OLE.rb b/ext/win32ole/tests/testWIN32OLE.rb deleted file mode 100644 index 679169d68c..0000000000 --- a/ext/win32ole/tests/testWIN32OLE.rb +++ /dev/null @@ -1,100 +0,0 @@ -# You need RubyUnit and MS Excel and MSI to run this test script - -require 'test/unit' -require 'runit/testcase' -# require 'runit/cui/testrunner' - -require 'win32ole' -require 'oleserver' - -module EXCEL_CONST -end - -module CONST1 -end - -module CONST2 -end - -module CONST3 -end - -class TestWin32OLE < RUNIT::TestCase - include OLESERVER - def setup - @excel = WIN32OLE.new("Excel.Application") - @excel.visible = true - 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_convert_bignum - book = @excel.workbooks.add - sheet = book.worksheets(1) - begin - sheet.range("A1").value = 999999999 - sheet.range("A2").value = 9999999999 - sheet.range("A3").value = "=A1*10 + 9" - assert_equal(9999999999, sheet.range("A2").value) - assert_equal(9999999999, sheet.range("A3").value) - - ensure - book.saved = true - end - end - - - def teardown - @excel.quit - @excel = nil - GC.start - end -end - - -# --------------------- -# -# a subclass of Win32OLE -# override new() and connect() -class MyExcel<WIN32OLE - def MyExcel.new - super "Excel.Application" - end - def MyExcel.connect - super "Excel.Application" - end -end - -class TestMyExcel < TestWin32OLE -# -# because we overrided new() and connect() -# we need to change the test. -# also, because the class will be different -# - def setup - @excel = MyExcel.new - @excel.visible = true - end - def test_s_new - assert_instance_of(MyExcel, @excel) - end - def test_s_connect - excel2 = MyExcel.connect - assert_instance_of(MyExcel, excel2) - end -end diff --git a/ext/win32ole/tests/testall.rb b/ext/win32ole/tests/testall.rb deleted file mode 100644 index 12e97e3913..0000000000 --- a/ext/win32ole/tests/testall.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test/unit' -require 'win32ole' -puts "Now Test Win32OLE version #{WIN32OLE::VERSION}" -require "testWIN32OLE" |