Sha256: 43fe64fa50cfc37ef04023cff3bd1c71604839facf24e98a0dd88d357fcf72f3

Contents?: true

Size: 1.41 KB

Versions: 25

Compression:

Stored size: 1.41 KB

Contents

Shindo.tests('Fog::Compute[:xenserver] | HostCpu model', ['xenserver']) do

  host = Fog::Compute[:xenserver].hosts.first
  host_cpu = host.host_cpus.first

  tests('The HostCpu model should') do
    tests('have attributes') do
      model_attribute_hash = host_cpu.attributes
      attributes = [
        :reference,
        :uuid,
        :family,
        :flags,
        :__host,
        :model_name,
        :model,
        :number,
        :other_config,
        :speed,
        :stepping,
        :utilisation,
        :vendor
      ]
      tests("The HostCpu model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { host_cpu.respond_to? attribute }
        end
      end
      tests("The attributes hash should have key") do
        attributes.each do |attribute|
          test("#{attribute}") { model_attribute_hash.key? attribute }
        end
      end
    end

    test('be a kind of Fog::Compute::XenServer::HostCpu') do
      host_cpu.kind_of? Fog::Compute::XenServer::HostCpu
    end

    test("return a valid host") do
      host_cpu.host.kind_of? Fog::Compute::XenServer::Host
    end

    test("have a valid vendor string") do
      host_cpu.vendor.kind_of? String
    end

    test("have a valid other_config") do
      host_cpu.other_config.kind_of? Hash
    end

    test("have a valid utilisation attribute") do
      host_cpu.utilisation.kind_of? Float
    end

  end

end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.34.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.33.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.32.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.31.0 tests/xenserver/models/compute/host_cpu_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.30.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.29.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.28.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.27.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.26.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.25.0 tests/xenserver/models/compute/host_cpu_tests.rb
nsidc-fog-1.24.1 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.24.0 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.11 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.10 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.9 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.8 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.7 tests/xenserver/models/compute/host_cpu_tests.rb
ns-fog-1.22.6 tests/xenserver/models/compute/host_cpu_tests.rb