Sha256: 90f33afec44dbbd67b391d4fe5c74c16d83d28cd2e72a2d5bb07a9103b54851f

Contents?: true

Size: 881 Bytes

Versions: 5

Compression:

Stored size: 881 Bytes

Contents

Shindo.tests("Fog::Compute[:vsphere] | vm_clone request", 'vsphere') do
  #require 'guid'
  template = "/Datacenters/Solutions/vm/Jeff/Templates/centos56gm2"
  compute = Fog::Compute[:vsphere]

  tests("The return value should") do
    response = compute.vm_clone('path' => template, 'name' => 'cloning_vm')
    test("be a kind of Hash") { response.kind_of? Hash }
    %w{ vm_ref task_ref }.each do |key|
      test("have a #{key} key") { response.has_key? key }
    end
  end
  tests("When invalid input is presented") do
    raises(ArgumentError, 'it should raise ArgumentError') { compute.vm_clone(:foo => 1) }
    raises(Fog::Compute::Vsphere::NotFound, 'it should raise Fog::Compute::Vsphere::NotFound when the UUID is not a string') do
      pending # require 'guid'
      compute.vm_clone('instance_uuid' => Guid.from_s(template), 'name' => 'jefftestfoo')
    end
  end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb
fog-1.1.2 tests/vsphere/requests/compute/vm_clone_tests.rb
fog_tractical-1.1.4 tests/vsphere/requests/compute/vm_clone_tests.rb
fog_tractical-1.1.3 tests/vsphere/requests/compute/vm_clone_tests.rb