Sha256: 4ce90a5c351e133a6ccb5aaf5277b5965a126f6a0200be08ec060ef29372648d

Contents?: true

Size: 1.67 KB

Versions: 51

Compression:

Stored size: 1.67 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))

Shindo.tests("Compute::VcloudDirector | vdcs", ['vclouddirector', 'all']) do
  pending if Fog.mocking?
  tests("#There is one or more vdc").returns(true){ organization.vdcs.size >= 1 }

  vdcs = organization.vdcs
  vdc = vdcs.first

  tests("Compute::VcloudDirector | vdc") do
    tests("#id").returns(String) { vdc.id.class }
    tests("#name").returns(String) { vdc.name.class }
    tests("#href").returns(String) { vdc.href.class }
    tests("#type").returns("application/vnd.vmware.vcloud.vdc+xml") { vdc.type }
  end

  tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do
    vdc.lazy_load_attrs.each do |lazy_attr|
      tests("##{lazy_attr} is not loaded yet").returns(NonLoaded) { vdc.attributes[lazy_attr] }
    end
  end

  tests("Compute::VcloudDirector | vdc", ['load on demand']) do
    tests("#description is not loaded yet").returns(NonLoaded) { vdc.attributes[:description] }
    tests("#description is loaded on demand").returns(String) { vdc.description.class }
    tests("#description is now loaded").returns(true) { vdc.attributes[:description] != NonLoaded }
  end

  tests("Compute::VcloudDirector | vdc", ['lazy load attrs']) do
    lazy_attrs = vdc.lazy_load_attrs
    lazy_attrs.delete(:storage_capacity) if vcloud_director.api_version.to_f >= 5.1
    lazy_attrs.each do |lazy_attr|
      tests("##{lazy_attr} is now loaded").returns(true) { vdc.attributes[lazy_attr] != NonLoaded }
    end
  end

  tests("Compute::VcloudDirector | vdc", ['get']) do
    tests("#get_by_name").returns(vdc.name) { vdcs.get_by_name(vdc.name).name }
    tests("#get").returns(vdc.id) { vdcs.get(vdc.id).id }
  end
end

Version data entries

51 entries across 51 versions & 4 rubygems

Version Path
fog-maestrodev-1.19.0.20140109202555 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.19.0.20140107192102 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.19.0.20140107142106 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.19.0.20131219203941 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131219193542 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-1.19.0 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131219033443 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131219032002 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131219030716 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131219022322 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131218202447 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131209091424 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131209090811 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131206115947 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131205181604 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131127194823 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131126183714 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131126122111 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131125111730 tests/vcloud_director/models/compute/vdcs_tests.rb
fog-maestrodev-1.18.0.20131125083406 tests/vcloud_director/models/compute/vdcs_tests.rb