Updated resource to follow RSpec convention

Closes #31

Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
This commit is contained in:
Russell Seymour 2017-03-02 14:08:33 +00:00
parent de1b7134ef
commit ef323e3b31
4 changed files with 6 additions and 6 deletions

View file

@ -188,7 +188,7 @@ it { should have_boot_diagnostics }
| Resource Name | Resources | Description | | Resource Name | Resources | Description |
|---------------|-----------|-------------| |---------------|-----------|-------------|
| azure_vm_datadisks | has_disks? | Boolean test to see if a machine has datadisks | | azure_vm_datadisks | has_data_disks? | Boolean test to see if a machine has datadisks |
| | count | Returns the number of data disks attached to the machine | | | count | Returns the number of data disks attached to the machine |
| | where | Filter that allows for different tests to be performed, see examples below | | | where | Filter that allows for different tests to be performed, see examples below |

View file

@ -26,7 +26,7 @@ where
* `MyResourceGroup` is the name of the resouce group that the machine is in. * `MyResourceGroup` is the name of the resouce group that the machine is in.
* `matcher` is one of * `matcher` is one of
- `count` the number of data disks attached to the machine - `count` the number of data disks attached to the machine
- `has_disks?` boolean test denoting if data disks are attached - `has_data_disks?` boolean test denoting if data disks are attached
- `entries` used with the `where` filter to check the size of a disk - `entries` used with the `where` filter to check the size of a disk
* `value` is the expected output fdrom the matcher * `value` is the expected output fdrom the matcher
@ -48,12 +48,12 @@ Returns the number of data disks attached to the machine
its('count') { should eq 1 } its('count') { should eq 1 }
``` ```
### has_disks? ### has_data_disks?
Returns a boolean denoting if any data disks are attached to the machine Returns a boolean denoting if any data disks are attached to the machine
```ruby ```ruby
its('has_disks?') { should be true } it { should have_data_disks }
``` ```
### entries ### entries

View file

@ -69,7 +69,7 @@ class AzureVmDataDisks < Inspec.resource(1)
# #
# @return [Boolean] States if the VM has any disks attached # @return [Boolean] States if the VM has any disks attached
# #
def has_disks? def has_data_disks?
!entries.empty? !entries.empty?
end end

View file

@ -12,7 +12,7 @@ control 'azure-vm-datadisks-1.0' do
# Ensure that the named machine has 1 data disk # Ensure that the named machine has 1 data disk
describe azure_virtual_machine_datadisks(name: vm_internal, resource_group: resource_group_name) do describe azure_virtual_machine_datadisks(name: vm_internal, resource_group: resource_group_name) do
its('has_disks?') { should be true } it { should have_data_disks }
its('count') { should eq 1 } its('count') { should eq 1 }
end end