Class: TestWin32OLE_WITH_MSI

Inherits:
RUNIT::TestCase
  • Object
show all
Defined in:
tests/testWIN32OLE.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



286
287
288
289
# File 'tests/testWIN32OLE.rb', line 286

def setup
  installer = WIN32OLE.new("WindowsInstaller.Installer")
  @record = installer.CreateRecord(2)
end

#test__invokeObject



308
309
310
311
# File 'tests/testWIN32OLE.rb', line 308

def test__invoke
  shell=WIN32OLE.new('Shell.Application')
  assert_equal(shell.NameSpace(0).title, shell._invoke(0x60020002, [0], [WIN32OLE::VARIANT::VT_VARIANT]).title)
end

#test_bracket_equal_with_argObject



303
304
305
306
# File 'tests/testWIN32OLE.rb', line 303

def test_bracket_equal_with_arg
  @record[ "StringData", 1 ] =  'ffff'
  assert_equal('ffff', @record.StringData(1))
end

#test_setpropertyObject

Sorry, this test fails. Win32OLE does not support this style to set property. Use Win32OLE#setproperty or Win32OLE#[]= . def test_invoke

@record.invoke("StringData", 1, 'cccc')
assert_equal('cccc', @record.StringData(1))

end



299
300
301
302
# File 'tests/testWIN32OLE.rb', line 299

def test_setproperty
  @record.setproperty( "StringData", 1, 'dddd')
  assert_equal('dddd', @record.StringData(1))
end