ruby-changes:6495
From: suke <ko1@a...>
Date: Thu, 10 Jul 2008 21:22:53 +0900 (JST)
Subject: [ruby-changes:6495] Ruby:r18011 (trunk): * test/win32ole/test_win32ole_typelib.rb: add some illegal argument test.
suke 2008-07-10 21:22:16 +0900 (Thu, 10 Jul 2008) New Revision: 18011 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18011 Log: * test/win32ole/test_win32ole_typelib.rb: add some illegal argument test. * test/win32ole/test_win32ole_type.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. * test/win32ole/test_win32ole_param.rb: ditto. * test/win32ole/test_win32ole_method.rb: ditto. Modified files: trunk/ChangeLog trunk/test/win32ole/test_win32ole_event.rb trunk/test/win32ole/test_win32ole_method.rb trunk/test/win32ole/test_win32ole_param.rb trunk/test/win32ole/test_win32ole_type.rb trunk/test/win32ole/test_win32ole_typelib.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 18010) +++ ChangeLog (revision 18011) @@ -1,3 +1,16 @@ +Thu Jul 10 21:15:49 2008 Masaki Suketa <masaki.suketa@n...> + + * test/win32ole/test_win32ole_typelib.rb: add some illegal argument + test. + + * test/win32ole/test_win32ole_type.rb: ditto. + + * test/win32ole/test_win32ole_event.rb: ditto. + + * test/win32ole/test_win32ole_param.rb: ditto. + + * test/win32ole/test_win32ole_method.rb: ditto. + Thu Jul 10 19:38:35 2008 wanabe <s.wanabe@g...> * test/ruby/envutil.rb (assert_normal_exit): r17993 revert. Index: test/win32ole/test_win32ole_method.rb =================================================================== --- test/win32ole/test_win32ole_method.rb (revision 18010) +++ test/win32ole/test_win32ole_method.rb (revision 18011) @@ -33,6 +33,9 @@ assert_raise(WIN32OLERuntimeError) { method = WIN32OLE_METHOD.new(ole_type, "NonExistMethod") } + assert_raise(TypeError) { + method = WIN32OLE_METHOD.new(ole_type, 1) + } method = WIN32OLE_METHOD.new(ole_type, "Open") assert_instance_of(WIN32OLE_METHOD, method) method = WIN32OLE_METHOD.new(ole_type, "open") Index: test/win32ole/test_win32ole_param.rb =================================================================== --- test/win32ole/test_win32ole_param.rb (revision 18010) +++ test/win32ole/test_win32ole_param.rb (revision 18011) @@ -29,6 +29,13 @@ @param_overwritefiles = m_copyfile.params[2] end + def test_s_new + assert_raise(ArgumentError) { + WIN32OLE_PARAM.new("hoge") + } + end + + def test_name assert_equal('URL', @param_url.name) assert_equal('Flags', @param_flags.name) Index: test/win32ole/test_win32ole_event.rb =================================================================== --- test/win32ole/test_win32ole_event.rb (revision 18010) +++ test/win32ole/test_win32ole_event.rb (revision 18011) @@ -30,6 +30,12 @@ @event += event end + def test_s_new + assert_raise(TypeError) { + ev = WIN32OLE_EVENT.new("A") + } + end + def test_s_new_without_itf ev = WIN32OLE_EVENT.new(@ie) ev.on_event {|*args| default_handler(*args)} Index: test/win32ole/test_win32ole_type.rb =================================================================== --- test/win32ole/test_win32ole_type.rb (revision 18010) +++ test/win32ole/test_win32ole_type.rb (revision 18011) @@ -22,6 +22,12 @@ assert_raise(ArgumentError) { WIN32OLE_TYPE.new("foo") } + assert_raise(TypeError) { + WIN32OLE_TYPE.new(1, 2) + } + assert_raise(TypeError) { + WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", 1) + } assert_raise(WIN32OLERuntimeError) { WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "foo") } Index: test/win32ole/test_win32ole_typelib.rb =================================================================== --- test/win32ole/test_win32ole_typelib.rb (revision 18010) +++ test/win32ole/test_win32ole_typelib.rb (revision 18011) @@ -18,6 +18,11 @@ assert_raise(ArgumentError) { WIN32OLE_TYPELIB.new(1,2,3,4) } + + assert_raise(TypeError) { + WIN32OLE_TYPELIB.new(100) + } + tlib = WIN32OLE_TYPELIB.new("Microsoft Shell Controls And Automation") assert_instance_of(WIN32OLE_TYPELIB, tlib) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/