Sha256: 3f79374dbb15b213e0e538341377e95e9ac5d04dbb19dd0c4f7ac542abe29145
Contents?: true
Size: 1023 Bytes
Versions: 32
Compression:
Stored size: 1023 Bytes
Contents
require File.expand_path '../../test_helper', __dir__ # Test class for Get Resource Group Request class TestGetResourceGroup < Minitest::Test def setup @service = Fog::Resources::AzureRM.new(credentials) @rmc_client = @service.instance_variable_get(:@rmc) @resource_groups = @rmc_client.resource_groups end def test_check_resource_group_exists_success @resource_groups.stub :check_existence, true do assert @service.check_resource_group_exists('fog-test-rg') end end def test_check_resource_group_exists_failure @resource_groups.stub :check_existence, false do assert !@service.check_resource_group_exists('fog-test-rg') end end def test_check_resource_group_exists_exception response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) } @resource_groups.stub :check_existence, response do assert_raises(RuntimeError) { @service.check_resource_group_exists('fog-test-rg') } end end end
Version data entries
32 entries across 32 versions & 4 rubygems