diff options
Diffstat (limited to 'spec/ruby/library/win32ole/win32ole/_invoke_spec.rb')
-rw-r--r-- | spec/ruby/library/win32ole/win32ole/_invoke_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb b/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb new file mode 100644 index 0000000000..c2fe9a8490 --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb @@ -0,0 +1,23 @@ +require File.expand_path('../../fixtures/classes', __FILE__) + +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE#_invoke" do + before :each do + @shell = WIN32OLESpecs.new_ole 'Shell.application' + end + + it "raises ArgumentError if insufficient number of arguments are given" do + lambda { @shell._invoke() }.should raise_error ArgumentError + lambda { @shell._invoke(0) }.should raise_error ArgumentError + lambda { @shell._invoke(0, []) }.should raise_error ArgumentError + end + + it "dispatches the method bound to a specific ID" do + @shell._invoke(0x60020002, [37], [WIN32OLE::VARIANT::VT_VARIANT]).title.should =~ /System32/i + end + + end + +end |