File: test_misc.rb

package info (click to toggle)
ruby-rbvmomi 1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,756 kB
  • sloc: ruby: 5,590; sh: 36; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'test_helper'

class MiscTest < Test::Unit::TestCase
  def test_overridden_const
    assert(VIM::SecurityError < RbVmomi::BasicTypes::Base)
    assert_equal 'SecurityError', VIM::SecurityError.wsdl_name
  end

  # XXX
  def disabled_test_dynamically_overridden_const
    assert !VIM.const_defined?(:ClusterAttemptedVmInfo)
    Object.const_set :ClusterAttemptedVmInfo, :override
    assert VIM::ClusterAttemptedVmInfo.is_a?(Class)
    assert(VIM::ClusterAttemptedVmInfo < RbVmomi::BasicTypes::Base)
    assert_equal 'ClusterAttemptedVmInfo', VIM::ClusterAttemptedVmInfo.wsdl_name
  end

  def test_loader
    klass = VIM.loader.get('HostSystem')
    klass2 = VIM::HostSystem
    assert_equal klass, klass2
  end
end