1
Feature: Check for conditional attribute blocks with only strings
3
In order to avoid wrongly actioning a resource
5
I want to identify conditional attribute blocks that consist only of strings
8
Given a cookbook recipe that declares a resource with a <conditional_attribute>
9
When I check the cookbook
10
Then the conditional block contains only string warning 026 should be <show_warning>
13
| conditional_attribute | show_warning |
14
| not_if { "ls foo" } | shown |
15
| not_if do "ls foo" end | shown |
16
| only_if { "ls #{node['foo']['path']}" } | shown |
17
| not_if { "ls #{foo.method()}" } | shown |
18
| only_if { foo.bar } | not shown |
19
| not_if { foo.to_s } | not shown |
20
| not_if { File.exists?("/etc/foo") } | not shown |