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

Version Path
fog-azure-rm-0.4.5 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-temp-0.0.5 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.4.4 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.4.3 test/requests/resources/test_check_resource_group_exists.rb
far-gem-0.5.1 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.4.2 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.4.1 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.4.0 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.9 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.8 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.7 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.6 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.5 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.4 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-temp-0.0.4 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-temp-0.0.3 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.3 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-temp-0.0.2 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-temp-0.0.1 test/requests/resources/test_check_resource_group_exists.rb
fog-azure-rm-0.3.2 test/requests/resources/test_check_resource_group_exists.rb