Sha256: 5246fa9fb7082bf6fe37e39409cf9f1a5bbab6b18c505214e0cb4eb8a300a43c

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path '../../test_helper', __dir__

class TestVirtualMachineExtensions < Minitest::Test
  def setup
    @service = Fog::Compute::AzureRM.new(credentials)
    @vm_extensions = Fog::Compute::AzureRM::VirtualMachineExtensions.new(resource_group: 'fog-test-rg', service: @service)
    @compute_client = @service.instance_variable_get(:@compute_mgmt_client)
    @response = ApiStub::Models::Compute::VirtualMachineExtension.create_vm_extension_response(@compute_client)
  end

  def test_collection_methods
    methods = [
      :all,
      :get
    ]
    methods.each do |method|
      assert_respond_to @vm_extensions, method
    end
  end

  def test_collection_attributes
    attributes = [
      :resource_group,
      :vm_name
    ]
    attributes.each do |attribute|
      assert_respond_to @vm_extensions, attribute
    end
  end

  def test_get_method_response
    @service.stub :get_vm_extension, @response do
      assert_instance_of Fog::Compute::AzureRM::VirtualMachineExtension, @vm_extensions.get('fog-test-rg', 'fog-test-server', 'fog-test-extension')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 test/models/compute/test_virtual_machine_extensions.rb
fog-azure-rm-0.1.0 test/models/compute/test_virtual_machine_extensions.rb
fog-azure-rm-0.0.9 test/models/compute/test_virtual_machine_extensions.rb