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-1.22.0 tests/vsphere/models/compute/server_tests.rb
fog-1.21.0 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/vsphere/models/compute/server_tests.rb
fog-1.20.0 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/vsphere/models/compute/server_tests.rb
fog-1.19.0 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/vsphere/models/compute/server_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/vsphere/models/compute/server_tests.rb