This repository has been archived by the owner on Sep 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FC026: Conditional contains only string, refs #30.
- Loading branch information
Andrew Crump
committed
May 21, 2012
1 parent
e3b2941
commit 243ec01
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Feature: Check for conditional attribute blocks with only strings | ||
|
||
In order to avoid wrongly actioning a resource | ||
As a developer | ||
I want to identify conditional attribute blocks that consist only of strings | ||
|
||
Scenario Outline: | ||
Given a cookbook recipe that declares a resource with a <conditional_attribute> | ||
When I check the cookbook | ||
Then the conditional block contains only string warning 026 should be <show_warning> | ||
|
||
Examples: | ||
| conditional_attribute | show_warning | | ||
| not_if { "ls foo" } | shown | | ||
| not_if do "ls foo" end | shown | | ||
| only_if { "ls #{node['foo']['path']}" } | shown | | ||
| not_if { "ls #{foo.method()}" } | shown | | ||
| only_if { foo.bar } | not shown | | ||
| not_if { foo.to_s } | not shown | | ||
| not_if { File.exists?("/etc/foo") } | not shown | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters