Sha256: 3cbbb26b1fb6dd2ebf008587db4bfa8847aa2011b7f51cb1fa3e76176d6186fd

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

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(MsRestAzure::AzureOperationError) { @service.check_resource_group_exists('fog-test-rg') }
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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