Sha256: 299bfad8684e2fd50cd5a2b3c8d57751c01f64155387efc19145bbea0bd5ff28

Contents?: true

Size: 936 Bytes

Versions: 14

Compression:

Stored size: 936 Bytes

Contents

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

# Test class for List Vault Request
class TestListVaults < Minitest::Test
  def setup
    @service = Fog::KeyVault::AzureRM.new(credentials)
    @key_vault_client = @service.instance_variable_get(:@key_vault_client)
    @vaults = @key_vault_client.vaults
  end

  def test_list_vaults_success
    mocked_response = ApiStub::Requests::KeyVault::Vault.list_vault_response(@key_vault_client)
    @vaults.stub :list_by_resource_group_as_lazy, mocked_response do
      assert_equal @service.list_vaults('fog-test-rg'), mocked_response.value
    end
  end

  def test_list_vaults_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @vaults.stub :list_by_resource_group_as_lazy, response do
      assert_raises(MsRestAzure::AzureOperationError) { @service.list_vaults('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/key_vault/test_list_vaults.rb
fog-azure-rm-0.5.3 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.5.2 test/requests/key_vault/test_list_vaults.rb
far-gem-0.5.6 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.5.1 test/requests/key_vault/test_list_vaults.rb
far-gem-0.5.5 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.5.0 test/requests/key_vault/test_list_vaults.rb
far-gem-0.5.4 test/requests/key_vault/test_list_vaults.rb
far-gem-0.5.3 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.4.9 test/requests/key_vault/test_list_vaults.rb
far-gem-0.5.2 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.4.8 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.4.7 test/requests/key_vault/test_list_vaults.rb
fog-azure-rm-0.4.6 test/requests/key_vault/test_list_vaults.rb