From 7842d37fb3e4776ca1d87966a4ce4868f9a23474 Mon Sep 17 00:00:00 2001 From: Russell Seymour Date: Wed, 1 Mar 2017 17:32:17 +0000 Subject: [PATCH] Renamed azure_rg resource Closes #25 Signed-off-by: Russell Seymour --- README.md | 6 +++--- .../resources/azure/azure_resource_group.rb | 2 +- test/integration/azure/verify/controls/resources.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename libraries/azure_rg.rb => lib/resources/azure/azure_resource_group.rb (99%) diff --git a/README.md b/README.md index 57571694c..465166f7d 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ end ### Available Resources -- `azure_rg` - This resource reads information about the resources in the specified resource group +- `azure_resource_group` - This resource reads information about the resources in the specified resource group | Resource Name | Resources | Description | |---------------|-----------|-------------| @@ -136,7 +136,7 @@ control 'azure-1' do impact 1.0 title 'Checks that there is only one storage account in the resource group' - describe azure_rg(name: 'MyResourceGroup').where { type == 'Microsoft.Storage/storageAccounts' }.entries do + describe azure_resource_group(name: 'MyResourceGroup').where { type == 'Microsoft.Storage/storageAccounts' }.entries do its('count') { should eq 1 } end end @@ -149,7 +149,7 @@ control 'azure-1' do impact 1.0 title 'Checks a resource with the name "example-VM" exists' - describe azure_rg(name: 'MyResourceGroup').contains(parameter: 'name', value: 'example-VM') do + describe azure_resource_group(name: 'MyResourceGroup').contains(parameter: 'name', value: 'example-VM') do it { should be true } end end diff --git a/libraries/azure_rg.rb b/lib/resources/azure/azure_resource_group.rb similarity index 99% rename from libraries/azure_rg.rb rename to lib/resources/azure/azure_resource_group.rb index 58850a2bb..5bf216b05 100644 --- a/libraries/azure_rg.rb +++ b/lib/resources/azure/azure_resource_group.rb @@ -9,7 +9,7 @@ require 'azure_backend' # @attr_reader [Azure::ARM::Resources::Models::ResourceGroup] rg Resource group under interrogation # @attr_reader [Hashtable] counts Hashtable containing the counts of the different types in the resource group class AzureRg < Inspec.resource(1) - name 'azure_rg' + name 'azure_resource_group' desc " This resource returns information about the specified resource group diff --git a/test/integration/azure/verify/controls/resources.rb b/test/integration/azure/verify/controls/resources.rb index f02fe2c74..9417f5443 100644 --- a/test/integration/azure/verify/controls/resources.rb +++ b/test/integration/azure/verify/controls/resources.rb @@ -7,7 +7,7 @@ control 'azure-resources-1.0' do title 'Check that the resource group has the correct resources' # Ensure that the expected resources have been deployed - describe azure_rg(name: 'Inspec-Azure') do + describe azure_resource_group(name: 'Inspec-Azure') do its('total') { should eq 7 } its('vm_count') { should eq 2 } its('nic_count') { should eq 2 }