Sha256: e06ca19f1597b6c58fb856ede7139052852632d0f5bd64cf535f5ef456d2d580
Contents?: true
Size: 934 Bytes
Versions: 14
Compression:
Stored size: 934 Bytes
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for List Resource Groups Request class TestListResourceGroups < Minitest::Test def setup @service = Fog::Resources::AzureRM.new(credentials) @client = @service.instance_variable_get(:@rmc) @resource_groups = @client.resource_groups end def test_list_resource_group_success mocked_response = ApiStub::Requests::Resources::ResourceGroup.list_resource_group_response(@client) @resource_groups.stub :list_as_lazy, mocked_response do assert_equal @service.list_resource_groups, mocked_response.value end end def test_list_resource_group_failure response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @resource_groups.stub :list_as_lazy, response do assert_raises(MsRestAzure::AzureOperationError) { @service.list_resource_groups } end end end
Version data entries
14 entries across 14 versions & 2 rubygems