Sha256: 8f50377b8d70ad3d596cfce615d28971e5a63d2e8ca74ce329b7595a62594603

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true
module ChefProvisioningVsphereStubs
  class VsphereHelperStub < ChefProvisioningVsphere::VsphereHelper
    def initialize; end

    def network_device_changes(_action_handler, _vm_template, _options)
      [
        [RbVmomi::VIM::VirtualDeviceConfigSpec.new],
        [RbVmomi::VIM::VirtualDeviceConfigSpec.new],
      ]
    end

    def find_host(_host_name)
      RbVmomi::VIM::HostSystem.new
    end

    def find_pool(_pool_name)
      RbVmomi::VIM::ResourcePool.new(nil, nil)
    end

    def find_datastore(_datastore_name)
      RbVmomi::VIM::Datastore.new
    end

    def find_customization_spec(_options)
      RbVmomi::VIM::CustomizationSpec.new
    end

    def create_delta_disk(vm_template); end
  end
end

module RbVmomi
  class VIM::HostSystem
    attr_reader :parent

    def parent # rubocop:disable Lint/DuplicateMethods
      @parent ||= RbVmomi::VIM::ComputeResource.new
    end
  end
end

module RbVmomi
  class VIM::ComputeResource
    attr_reader :resourcePool

    def resourcePool # rubocop:disable Lint/DuplicateMethods
      @resourcePool ||= RbVmomi::VIM::ResourcePool.new(nil, nil) # rubocop:disable Naming/VariableName
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-provisioning-vsphere-2.3.1 spec/unit_tests/support/vsphere_helper_stub.rb
chef-provisioning-vsphere-2.3.0 spec/unit_tests/support/vsphere_helper_stub.rb