summaryrefslogtreecommitdiff
path: root/spec/ruby/library/win32ole/win32ole/_invoke_spec.rb
blob: 91f5091d247fd30b770b680fa6af09c1633c01fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
platform_is :windows do
  require_relative '../fixtures/classes'

  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
      -> { @shell._invoke() }.should raise_error ArgumentError
      -> { @shell._invoke(0) }.should raise_error ArgumentError
      -> { @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