Sha256: 5764dade105fad5dbb3632b8b35e649951084ce85bd305ad298b55be04c07abd

Contents?: true

Size: 937 Bytes

Versions: 6

Compression:

Stored size: 937 Bytes

Contents

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

# Test class for Delete Subnet Request
class TestDeleteSubnet < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @network_client = @service.instance_variable_get(:@network_client)
    @subnets = @network_client.subnets
  end

  def test_delete_subnet_success
    response = ApiStub::Requests::Network::Subnet.delete_subnet_response
    @subnets.stub :delete, response do
      assert @service.delete_subnet('fog-test-rg', 'fog-test-subnet', 'fog-test-virtual-network')
    end
  end

  def test_delete_subnet_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @subnets.stub :delete, response do
      assert_raises(RuntimeError) { @service.delete_subnet('fog-test-rg', 'fog-test-subnet', 'fog-test-virtual-network') }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 test/requests/network/test_delete_subnet.rb
fog-azure-rm-0.1.0 test/requests/network/test_delete_subnet.rb
fog-azure-rm-0.0.9 test/requests/network/test_delete_subnet.rb
fog-azure-rm-0.0.8 test/requests/network/test_delete_subnet.rb
fog-azure-rm-0.0.6 test/requests/network/test_delete_subnet.rb
fog-azure-rm-0.0.5 test/requests/network/test_delete_subnet.rb