Sha256: 2048e6cb8a2d56e8a455522e0097d5ae39e1f087b318fe99cd1567476706fde9

Contents?: true

Size: 1.71 KB

Versions: 25

Compression:

Stored size: 1.71 KB

Contents

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

  pools = Fog::Compute[:xenserver].pools
  pool = pools.first

  tests('The Pool model should') do
    tests('have the action') do
      test('reload') { pool.respond_to? 'reload' }
    end
    tests('have attributes') do
      model_attribute_hash = pool.attributes
      attributes = [
        :reference,
        :uuid,
        :name,
        :description,
        :__default_sr,
        :__master,
        :tags,
        :restrictions,
        :ha_enabled,
        :vswitch_controller,
        :__suspend_image_sr
      ]
      tests("The Pool model should respond to") do
        attributes.each do |attribute|
          test("#{attribute}") { pool.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::Pool') { pool.kind_of? Fog::Compute::XenServer::Pool}

  end

  tests("A real Pool should") do
    tests("return a valid default_storage_repository") do
      test("should be a Fog::Compute::XenServer::StorageRepository") { pool.default_storage_repository.kind_of? Fog::Compute::XenServer::StorageRepository }
    end
    tests("return valid Host as the master") do
      test("should be a Fog::Compute::XenServer::Host") { pool.master.kind_of? Fog::Compute::XenServer::Host }
    end
    test("be able to be configured as a valid suspend_image_sr") do
      pool.suspend_image_sr = pool.default_storage_repository
      pool.reload
      pool.suspend_image_sr.reference == pool.default_storage_repository.reference
    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/pool_tests.rb
fog-1.34.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.33.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.32.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.31.0 tests/xenserver/models/compute/pool_tests.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/xenserver/models/compute/pool_tests.rb
fog-1.30.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.29.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.28.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.27.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.26.0 tests/xenserver/models/compute/pool_tests.rb
fog-1.25.0 tests/xenserver/models/compute/pool_tests.rb
nsidc-fog-1.24.1 tests/xenserver/models/compute/pool_tests.rb
fog-1.24.0 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.11 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.10 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.9 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.8 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.7 tests/xenserver/models/compute/pool_tests.rb
ns-fog-1.22.6 tests/xenserver/models/compute/pool_tests.rb