This repository has been archived by the owner on Sep 19, 2020. It is now read-only.
/
009_check_for_unrecognised_resource_attributes.feature
55 lines (46 loc) · 2.63 KB
/
009_check_for_unrecognised_resource_attributes.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Feature: Check for unrecognised resource attributes
In order to identify typos in recipes without the need for a converge
As a developer
I want to identify use of standard resources with unrecognised attributes
Scenario Outline: Unrecognised attribute declared on built-in resource
Given a recipe that declares a <type> resource with these attributes: <attributes>
When I check the cookbook
Then the unrecognised attribute warning 009 should be <shown>
Examples:
| type | attributes | shown |
| file | punter,group,mode,action | true |
| file | owner,group,rights,action | false |
| file | owner,group,mode,action | false |
| file | action,retries | false |
| group | gid | false |
| group | gid,membranes | true |
| package | version,action,options | false |
| package | verison,action,options | true |
Scenario: Resource declared using recognised attributes
Given a recipe that declares a resource with standard attributes
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed
Scenario: LWRP Resource
Given a recipe that declares a user-defined resource
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed
Scenario: Resource declared with only a name attribute
Given a recipe that declares a resource with only a name attribute
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed
Scenario: Unrecognised attribute on recipe with multiple resources of the same type
Given a recipe that declares multiple resources of the same type of which one has a bad attribute
When I check the cookbook
Then the unrecognised attribute warning 009 should be displayed against the correct resource
Scenario: Resource with conditional attributes
Given a recipe that declares a resource with recognised attributes and a conditional execution ruby block
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed
Scenario: Resource with nested block
Given a recipe that declares a resource with recognised attributes and a nested block
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed
Scenario: Resource with attribute method call
Given a recipe that declares a resource with an attribute value set to the result of a method call
When I check the cookbook
Then the unrecognised attribute warning 009 should not be displayed