Class: TestWin32OLE_WITH_MSI

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

Instance Method Summary collapse

Instance Method Details

#setupObject



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

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

#test__invokeObject



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

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



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

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



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

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