Sha256: be27b6c3a7c9a68a481d004be9791b9a1670e85e880724d5c5ce199bb0e06eef

Contents?: true

Size: 1.07 KB

Versions: 19

Compression:

Stored size: 1.07 KB

Contents

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

# Test class for Resource Group Model
class TestResourceGroup < Minitest::Test
  def setup
    @service = Fog::Resources::AzureRM.new(credentials)
    client = @service.instance_variable_get(:@rmc)
    @resource_group = resource_group(@service)
    @response = ApiStub::Models::Resources::ResourceGroup.create_resource_group_response(client)
  end

  def test_model_methods
    methods = [
      :save,
      :destroy
    ]
    methods.each do |method|
      assert_respond_to @resource_group, method
    end
  end

  def test_model_attributes
    attributes = [
      :id,
      :name,
      :location
    ]
    attributes.each do |attribute|
      assert_respond_to @resource_group, attribute
    end
  end

  def test_save_method_response
    @service.stub :create_resource_group, @response do
      assert_instance_of Fog::Resources::AzureRM::ResourceGroup, @resource_group.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_resource_group, @response do
      assert @resource_group.destroy
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
fog-azure-rm-temp-0.0.4 test/models/resources/test_resource_group.rb
fog-azure-rm-temp-0.0.3 test/models/resources/test_resource_group.rb
fog-azure-rm-0.3.3 test/models/resources/test_resource_group.rb
fog-azure-rm-temp-0.0.2 test/models/resources/test_resource_group.rb
fog-azure-rm-temp-0.0.1 test/models/resources/test_resource_group.rb
fog-azure-rm-0.3.2 test/models/resources/test_resource_group.rb
fog-azure-rm-downgraded-0.3.1 test/models/resources/test_resource_group.rb
fog-azure-rm-0.3.1 test/models/resources/test_resource_group.rb
fog-azure-rm-downgraded-0.3.0 test/models/resources/test_resource_group.rb
fog-azure-rm-0.3.0 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.7 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.6 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.5 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.4 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.3 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.2 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.1 test/models/resources/test_resource_group.rb
fog-azure-rm-0.2.0 test/models/resources/test_resource_group.rb
fog-azure-rm-0.1.2 test/models/resources/test_resource_group.rb