Sha256: 9f07ff4b1dd745fc6003b7b5d59600b2c766d2fb770d734e5dc7b48bcd53155b

Contents?: true

Size: 899 Bytes

Versions: 5

Compression:

Stored size: 899 Bytes

Contents

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

# Test class for Delete Deployment Request
class TestDeleteDeployment < Minitest::Test
  def setup
    @service = Fog::Resources::AzureRM.new(credentials)
    client = @service.instance_variable_get(:@rmc)
    @deployments = client.deployments
    @resource_group = 'fog-test-rg'
    @deployment_name = 'fog-test-deployment'
  end

  def test_delete_deployment_success
    @deployments.stub :delete, true do
      assert @service.delete_deployment(@resource_group, @deployment_name)
    end
  end

  def test_list_deployment_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @deployments.stub :delete, response do
      assert_raises(RuntimeError) { @service.delete_deployment(@resource_group, @deployment_name) }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 test/requests/resources/test_delete_deployment.rb
fog-azure-rm-0.1.0 test/requests/resources/test_delete_deployment.rb
fog-azure-rm-0.0.9 test/requests/resources/test_delete_deployment.rb
fog-azure-rm-0.0.8 test/requests/resources/test_delete_deployment.rb
fog-azure-rm-0.0.6 test/requests/resources/test_delete_deployment.rb