Sha256: 7d7f05954863d038d04b257fcfbb90410734bdcc2ef9e3e1ef56fbed3f8cd8e2
Contents?: true
Size: 871 Bytes
Versions: 13
Compression:
Stored size: 871 Bytes
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Delete Virtual Machine Request class TestDeleteVirtualMachine < Minitest::Test def setup @service = Fog::Compute::AzureRM.new(credentials) compute_client = @service.instance_variable_get(:@compute_mgmt_client) @virtual_machines = compute_client.virtual_machines end def test_delete_virtual_machine_success @virtual_machines.stub :delete, true do assert @service.delete_virtual_machine('fog-test-rg', 'fog-test-server') end end def test_delete_virtual_machine_failure response = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @virtual_machines.stub :delete, response do assert_raises(RuntimeError) { @service.delete_virtual_machine('fog-test-rg', 'fog-test-server') } end end end
Version data entries
13 entries across 13 versions & 2 rubygems