Sha256: 9b18a933f1cf7087dd84a730cccb7074cdad22a842a45fd20f4964a41a7838cc

Contents?: true

Size: 1.42 KB

Versions: 62

Compression:

Stored size: 1.42 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.has_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

62 entries across 62 versions & 6 rubygems

Version Path
fog-1.22.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.21.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.20.0.20140305101839 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.20.0.20140305101305 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140212012611 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.20.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140110004459 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140110003812 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140109202555 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/xenserver/models/compute/host_cpu_tests.rb
fog-1.19.0 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/xenserver/models/compute/host_cpu_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/xenserver/models/compute/host_cpu_tests.rb