Sha256: b35156263bc92b2435b02fa566545588304cc74bc091822a7f1e15545bf587b0

Contents?: true

Size: 1.5 KB

Versions: 78

Compression:

Stored size: 1.5 KB

Contents

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

  pifs = Fog::Compute[:xenserver].pifs
  pif = pifs.first

  tests('The PIF model should') do
    tests('have the action') do
      test('reload') { pif.respond_to? 'reload' }
    end
    tests('have attributes') do
      model_attribute_hash = pif.attributes
      attributes = [ 
        :reference,
        :uuid,
        :physical,
        :mac,
        :currently_attached,
        :device,
        :metrics,
        :dns,
        :gateway,
        :ip,
        :ip_configuration_mode,
        :mtu,
        :__network,
        :netmask,
        :management,
        :vlan,
        :other_config,
        :__host
      ]
      tests("The PIF model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { pif.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::PIF') { pif.kind_of? Fog::Compute::XenServer::PIF}

  end

  tests("A real PIF should") do
    tests("return a valid network") do
      test("should be a Fog::Compute::XenServer::Network") { pif.network.kind_of? Fog::Compute::XenServer::Network }
    end
    tests("return valid host") do
      test("should be a Fog::Compute::XenServer::Host") { pif.host.kind_of? Fog::Compute::XenServer::Host }
    end

  end

end

Version data entries

78 entries across 78 versions & 11 rubygems

Version Path
fog-1.10.1 tests/xenserver/models/compute/pif_tests.rb
fog-parser-fix-1.6.1 tests/xenserver/models/compute/pif_tests.rb
fog-test-again-1.6.0 tests/xenserver/models/compute/pif_tests.rb
fog-test-me-1.10.0 tests/xenserver/models/compute/pif_tests.rb
fog-parser-fix-1.6.0 tests/xenserver/models/compute/pif_tests.rb
fog-1.10.0 tests/xenserver/models/compute/pif_tests.rb
fog-1.9.0 tests/xenserver/models/compute/pif_tests.rb
fog-maestrodev-1.8.0.20130114204828 tests/xenserver/models/compute/pif_tests.rb
fog-maestrodev-1.8.0.20130111070250 tests/xenserver/models/compute/pif_tests.rb
fog-maestrodev-1.8.0.20130109172219 tests/xenserver/models/compute/pif_tests.rb
fog-sgonyea-1.8.1 tests/xenserver/models/compute/pif_tests.rb
fog-1.8.0 tests/xenserver/models/compute/pif_tests.rb
fog-maestrodev-1.7.0.20121114190951 tests/xenserver/models/compute/pif_tests.rb
fog-1.7.0 tests/xenserver/models/compute/pif_tests.rb
fog-1.6.0 tests/xenserver/models/compute/pif_tests.rb
fog-1.5.0 tests/xenserver/models/compute/pif_tests.rb
rackspace-fog-1.4.2 tests/xenserver/models/compute/pif_tests.rb
fog-1.4.0 tests/xenserver/models/compute/pif_tests.rb