Sha256: d063d23578eb175a49746d848fa774647ea1484984d56e4ac9ed4923e64fc0bc

Contents?: true

Size: 1.58 KB

Versions: 44

Compression:

Stored size: 1.58 KB

Contents

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

Shindo.tests("Compute::VcloudDirector | vapps", ['vclouddirector', 'all']) do
  pending if Fog.mocking?

  # unless there is atleast one vapp we cannot run these tests
  pending if vdc.vapps.empty?

  vapps = vdc.vapps
  vapp = vapps.first

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

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

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

  tests("Compute::VcloudDirector | vapp", ['lazy load attrs']) do
    vapp.lazy_load_attrs.each do |lazy_attr|
      tests("##{lazy_attr} is now loaded").returns(true) { vapp.attributes[lazy_attr] != NonLoaded }
    end
  end

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

Version data entries

44 entries across 44 versions & 4 rubygems

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