Sha256: 8bbcff44394cde4c44734ee159489cada28a7b27c807b5e33249627ea59b98ca

Contents?: true

Size: 1.33 KB

Versions: 44

Compression:

Stored size: 1.33 KB

Contents

Shindo.tests('Fog::Compute[:vsphere] | server model', ['vsphere']) do

  servers = Fog::Compute[:vsphere].servers
  server = servers.last

  tests('The server model should') do
    tests('have the action') do
      test('reload') { server.respond_to? 'reload' }
      %w{ stop start destroy reboot }.each do |action|
        test(action) { server.respond_to? action }
        test("#{action} returns successfully") { server.send(action.to_sym) ? true : false }
      end
    end
    tests('have attributes') do
      model_attribute_hash = server.attributes
      attributes = [ :id,
        :instance_uuid,
        :uuid,
        :power_state,
        :tools_state,
        :mo_ref,
        :tools_version,
        :hostname,
        :mac_addresses,
        :operatingsystem,
        :connection_state,
        :hypervisor,
        :name,
        :public_ip_address]
      tests("The server model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { server.respond_to? attribute }
        end
      end
      tests("The attributes hash should have key") do
        attributes.each do |attribute|
          test("#{attribute}") { model_attribute_hash.has_key? attribute }
        end
      end
    end
    test('be a kind of Fog::Compute::Vsphere::Server') { server.kind_of? Fog::Compute::Vsphere::Server }
  end

end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
fog-maestrodev-1.18.0.20131209090811 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131123105121 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131122203507 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131121075022 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131118164830 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131115184302 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131114200144 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131112185232 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131111203459 tests/vsphere/models/compute/server_tests.rb
fog-1.18.0 tests/vsphere/models/compute/server_tests.rb
fog-1.17.0 tests/vsphere/models/compute/server_tests.rb
fog-1.16.0 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.15.0.20130927082724 tests/vsphere/models/compute/server_tests.rb