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.
add checks for correct use of use_inline_resources
- recommend use_inline_resource in all 'LWRPBase' providers - catch the use of use_inline_resources when users are also declaring `def action_whatever` instead of `action :whatever` which defeats use_inline_resources
- Loading branch information
1 parent
952d14f
commit 4728af6
Showing
7 changed files
with
211 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
features/057_check_for_library_provider_without_use_inline_resources.feature
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 library providers that do not declare use_inline_resources | ||
|
||
In order to ensure that notifications happen correctly | ||
As a cookbook provider author | ||
I want to always use_inline_resources | ||
|
||
Scenario: Library provider with use_inline_resources | ||
Given a cookbook that contains a library provider with use_inline_resources | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources warning 057 should not be displayed against the libraries file | ||
|
||
Scenario: Library provider without use_inline_resources | ||
Given a cookbook that contains a library provider without use_inline_resources | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources warning 057 should be displayed against the libraries file on line 11 | ||
|
||
Scenario: Library file without use_inline_resources | ||
Given a cookbook that contains a library resource | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources warning 057 should not be displayed against the libraries file |
25 changes: 25 additions & 0 deletions
25
features/058_check_for_library_provider_bad_action_methods.feature
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,25 @@ | ||
Feature: Check for library providers that declare use_inline_resources and declare action_<name> methods | ||
|
||
In order to ensure that notifications happen correctly | ||
As a cookbook provider author | ||
I want to always use_inline_resources | ||
|
||
Scenario: Library provider with use_inline_resources and bad action_create | ||
Given a cookbook that contains a library provider with use_inline_resources and uses def action_create | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources and bad action_create warning 058 should be displayed against the libraries file on line 11 | ||
|
||
Scenario: Library provider without use_inline_resources and (okay) action_create | ||
Given a cookbook that contains a library provider without use_inline_resources and uses def action_create | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file | ||
|
||
Scenario: Library provider without use_inline_resources | ||
Given a cookbook that contains a library provider without use_inline_resources | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file | ||
|
||
Scenario: Library provider with use_inline_resources | ||
Given a cookbook that contains a library provider with use_inline_resources | ||
When I check the cookbook | ||
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file |
15 changes: 15 additions & 0 deletions
15
features/059_check_for_lwrp_provider_without_use_inline_resources.feature
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,15 @@ | ||
Feature: Check for LWRP providers that do not declare use_inline_resources | ||
|
||
In order to ensure that notifications happen correctly | ||
As a cookbook provider author | ||
I want to always use_inline_resources | ||
|
||
Scenario: LWRP provider with use_inline_resources | ||
Given a cookbook that contains a LWRP provider with use_inline_resources | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources warning 059 should not be displayed against the provider file | ||
|
||
Scenario: LWRP provider without use_inline_resources | ||
Given a cookbook that contains a LWRP provider without use_inline_resources | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources warning 059 should be displayed against the provider file |
25 changes: 25 additions & 0 deletions
25
features/060_check_for_lwrp_provider_bad_action_methods.feature
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,25 @@ | ||
Feature: Check for LWRP providers that declare use_inline_resources and declare action_<name> methods | ||
|
||
In order to ensure that notifications happen correctly | ||
As a cookbook provider author | ||
I want to always use_inline_resources | ||
|
||
Scenario: LWRP provider with use_inline_resources and bad action_create | ||
Given a cookbook that contains a LWRP provider with use_inline_resources and uses def action_create | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should be displayed against the provider file on line 3 | ||
|
||
Scenario: LWRP provider without use_inline_resources | ||
Given a cookbook that contains a LWRP provider without use_inline_resources | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file | ||
|
||
Scenario: LWRP provider without use_inline_resources and (okay) action_create | ||
Given a cookbook that contains a LWRP provider without use_inline_resources and uses def action_create | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file | ||
|
||
Scenario: LWRP provider with use_inline_resources | ||
Given a cookbook that contains a LWRP provider with use_inline_resources | ||
When I check the cookbook | ||
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file |
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