Sha256: abfbe030befacc6a5ced4ec7739ec9bc8073adbbb3f8fc2a56124e345d1cbcab

Contents?: true

Size: 993 Bytes

Versions: 13

Compression:

Stored size: 993 Bytes

Contents

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

# Test class for List Resource Groups Request
class TestListResources < Minitest::Test
  def setup
    @service = Fog::Resources::AzureRM.new(credentials)
    @client = @service.instance_variable_get(:@rmc)
    @resources = @client.resource_groups
  end

  def test_list_resources_in_resource_group_success
    mocked_response = ApiStub::Requests::Resources::AzureResource.list_resources_in_resource_group(@client)
    @resources.stub :list_resources, mocked_response do
      assert_equal @service.list_resources_in_resource_group('fog-test-rg'), mocked_response
    end
  end

  def test_list_resources_in_resource_group_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @resources.stub :list_resources, response do
      assert_raises(MsRestAzure::AzureOperationError) { @service.list_resources_in_resource_group('fog-test-rg') }
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
fog-azure-rm-0.6.0 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.5.3 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.5.2 test/requests/resources/test_list_resources_in_resource_group.rb
far-gem-0.5.6 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.5.1 test/requests/resources/test_list_resources_in_resource_group.rb
far-gem-0.5.5 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.5.0 test/requests/resources/test_list_resources_in_resource_group.rb
far-gem-0.5.4 test/requests/resources/test_list_resources_in_resource_group.rb
far-gem-0.5.3 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.4.9 test/requests/resources/test_list_resources_in_resource_group.rb
far-gem-0.5.2 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.4.8 test/requests/resources/test_list_resources_in_resource_group.rb
fog-azure-rm-0.4.7 test/requests/resources/test_list_resources_in_resource_group.rb