foodcritic 10.2.2 → 10.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -2
  3. data/Gemfile +2 -1
  4. data/README.md +7 -1
  5. data/Rakefile +55 -35
  6. data/bin/foodcritic +1 -7
  7. data/features/024_check_for_missing_platforms.feature +3 -4
  8. data/features/continuous_integration_support.feature +2 -2
  9. data/features/step_definitions/cookbook_steps.rb +24 -285
  10. data/features/support/command_helpers.rb +3 -0
  11. data/foodcritic.gemspec +12 -6
  12. data/lib/foodcritic/api.rb +14 -2
  13. data/lib/foodcritic/command_line.rb +8 -0
  14. data/lib/foodcritic/linter.rb +1 -1
  15. data/lib/foodcritic/output.rb +17 -3
  16. data/lib/foodcritic/rules/fc008.rb +8 -6
  17. data/lib/foodcritic/rules/fc024.rb +1 -1
  18. data/lib/foodcritic/rules/fc045.rb +1 -8
  19. data/lib/foodcritic/rules/fc068.rb +1 -1
  20. data/lib/foodcritic/rules/fc069.rb +365 -0
  21. data/lib/foodcritic/rules/fc070.rb +63 -0
  22. data/lib/foodcritic/rules/fc071.rb +6 -0
  23. data/lib/foodcritic/rules/fc072.rb +6 -0
  24. data/lib/foodcritic/rules/fc073.rb +17 -0
  25. data/lib/foodcritic/rules/fc074.rb +10 -0
  26. data/lib/foodcritic/rules/fc075.rb +9 -0
  27. data/lib/foodcritic/version.rb +1 -1
  28. data/spec/functional/fc001_spec.rb +67 -0
  29. data/spec/functional/fc008_spec.rb +33 -0
  30. data/spec/functional/fc011_spec.rb +20 -0
  31. data/spec/functional/fc012_spec.rb +20 -0
  32. data/spec/functional/fc016_spec.rb +48 -0
  33. data/spec/functional/fc028_spec.rb +48 -0
  34. data/spec/functional/fc029_spec.rb +33 -0
  35. data/spec/functional/fc031_spec.rb +14 -0
  36. data/spec/functional/fc042_spec.rb +13 -0
  37. data/spec/functional/fc045_spec.rb +18 -0
  38. data/spec/functional/fc052_spec.rb +13 -0
  39. data/spec/functional/fc053_spec.rb +13 -0
  40. data/spec/functional/fc055_spec.rb +18 -0
  41. data/spec/functional/fc056_spec.rb +18 -0
  42. data/spec/functional/fc061_spec.rb +48 -0
  43. data/spec/functional/fc062_spec.rb +13 -0
  44. data/spec/functional/fc063_spec.rb +18 -0
  45. data/spec/functional/fc064_spec.rb +13 -0
  46. data/spec/functional/fc065_spec.rb +13 -0
  47. data/spec/functional/fc066_spec.rb +13 -0
  48. data/spec/functional/fc067_spec.rb +13 -0
  49. data/spec/functional/fc068_spec.rb +13 -0
  50. data/spec/functional/fc069_spec.rb +23 -0
  51. data/spec/functional/fc070_spec.rb +38 -0
  52. data/spec/functional/fc071_spec.rb +14 -0
  53. data/spec/functional/fc072_spec.rb +13 -0
  54. data/spec/functional/fc073_spec.rb +56 -0
  55. data/spec/functional/fc074_spec.rb +39 -0
  56. data/spec/functional/fc075_spec.rb +41 -0
  57. data/spec/functional/root_aliases_spec.rb +13 -0
  58. data/spec/regression/cookbooks.txt +0 -2
  59. data/spec/regression/expected/activemq.txt +5 -0
  60. data/spec/regression/expected/apparmor.txt +8 -0
  61. data/spec/regression/expected/apt.txt +12 -0
  62. data/spec/regression/expected/aws.txt +13 -0
  63. data/spec/regression/expected/bluepill.txt +6 -0
  64. data/spec/regression/expected/boost.txt +6 -0
  65. data/spec/regression/expected/build-essential.txt +6 -0
  66. data/spec/regression/expected/chef-client.txt +13 -0
  67. data/spec/regression/expected/chef-server.txt +12 -0
  68. data/spec/regression/expected/chef.txt +36 -0
  69. data/spec/regression/expected/chef_handler.txt +7 -0
  70. data/spec/regression/expected/cron.txt +7 -0
  71. data/spec/regression/expected/database.txt +13 -0
  72. data/spec/regression/expected/dmg.txt +12 -0
  73. data/spec/regression/expected/drbd.txt +25 -0
  74. data/spec/regression/expected/dynect.txt +29 -0
  75. data/spec/regression/expected/erlang.txt +4 -0
  76. data/spec/regression/expected/fail2ban.txt +4 -0
  77. data/spec/regression/expected/firewall.txt +12 -0
  78. data/spec/regression/expected/gecode.txt +8 -0
  79. data/spec/regression/expected/gems.txt +31 -0
  80. data/spec/regression/expected/gunicorn.txt +9 -0
  81. data/spec/regression/expected/heartbeat.txt +8 -0
  82. data/spec/regression/expected/homebrew.txt +8 -0
  83. data/spec/regression/expected/iis.txt +30 -0
  84. data/spec/regression/expected/iptables.txt +8 -0
  85. data/spec/regression/expected/jetty.txt +11 -0
  86. data/spec/regression/expected/jpackage.txt +8 -0
  87. data/spec/regression/expected/keepalived.txt +4 -0
  88. data/spec/regression/expected/kickstart.txt +14 -0
  89. data/spec/regression/expected/logwatch.txt +4 -0
  90. data/spec/regression/expected/lvm.txt +12 -0
  91. data/spec/regression/expected/maradns.txt +13 -0
  92. data/spec/regression/expected/maven.txt +9 -0
  93. data/spec/regression/expected/memcached.txt +30 -0
  94. data/spec/regression/expected/motd-tail.txt +4 -0
  95. data/spec/regression/expected/mysql.txt +12 -0
  96. data/spec/regression/expected/ohai.txt +6 -0
  97. data/spec/regression/expected/openldap.txt +10 -0
  98. data/spec/regression/expected/openssh.txt +4 -0
  99. data/spec/regression/expected/openssl.txt +5 -0
  100. data/spec/regression/expected/partial_search.txt +5 -0
  101. data/spec/regression/expected/passenger_apache2.txt +29 -0
  102. data/spec/regression/expected/perl.txt +11 -0
  103. data/spec/regression/expected/php.txt +9 -0
  104. data/spec/regression/expected/postfix.txt +6 -0
  105. data/spec/regression/expected/powershell.txt +8 -0
  106. data/spec/regression/expected/resolver.txt +6 -0
  107. data/spec/regression/expected/rsync.txt +10 -0
  108. data/spec/regression/expected/rsyslog.txt +8 -0
  109. data/spec/regression/expected/sql_server.txt +4 -0
  110. data/spec/regression/expected/sqlite.txt +4 -0
  111. data/spec/regression/expected/ssh_known_hosts.txt +5 -0
  112. data/spec/regression/expected/stompserver.txt +5 -0
  113. data/spec/regression/expected/subversion.txt +5 -0
  114. data/spec/regression/expected/sudo.txt +8 -0
  115. data/spec/regression/expected/tftp.txt +5 -0
  116. data/spec/regression/expected/tomcat.txt +8 -0
  117. data/spec/regression/expected/transmission.txt +10 -0
  118. data/spec/regression/expected/ubuntu.txt +4 -0
  119. data/spec/regression/expected/ufw.txt +9 -0
  120. data/spec/regression/expected/unicorn.txt +6 -0
  121. data/spec/regression/expected/users.txt +7 -0
  122. data/spec/regression/expected/vim.txt +6 -0
  123. data/spec/regression/expected/webpi.txt +7 -0
  124. data/spec/regression/expected/whitelist-node-attrs.txt +6 -0
  125. data/spec/regression/expected/windows.txt +57 -0
  126. data/spec/regression/expected/wix.txt +4 -0
  127. data/spec/regression/expected/xfs.txt +4 -0
  128. data/spec/regression/expected/xml.txt +4 -0
  129. data/spec/regression/expected/yum.txt +17 -0
  130. data/spec/regression/expected/zlib.txt +4 -0
  131. data/spec/regression/expected/zsh.txt +4 -0
  132. data/spec/regression/regression_spec.rb +16 -10
  133. data/spec/spec_helper.rb +115 -10
  134. data/spec/{foodcritic → unit}/api_spec.rb +549 -593
  135. data/spec/{foodcritic → unit}/chef_spec.rb +15 -15
  136. data/spec/unit/command_line_spec.rb +122 -0
  137. data/spec/{foodcritic → unit}/domain_spec.rb +12 -12
  138. data/spec/{foodcritic → unit}/linter_spec.rb +20 -35
  139. data/spec/{foodcritic → unit}/template_spec.rb +13 -13
  140. metadata +161 -33
  141. data/features/001_check_node_access.feature +0 -60
  142. data/features/008_check_for_boilerplate_metadata.feature +0 -25
  143. data/features/011_check_for_markdown_readme.feature +0 -20
  144. data/features/012_check_for_deprecated_readme_format.feature +0 -20
  145. data/features/016_check_for_no_lwrp_default_action.feature +0 -25
  146. data/features/028_check_for_incorrect_platform_method.feature +0 -20
  147. data/features/029_check_for_no_leading_cookbook_name.feature +0 -18
  148. data/features/031_check_for_metadata_existence.feature +0 -15
  149. data/features/042_check_for_deprecated_require_recipe.feature +0 -15
  150. data/features/045_check_for_cookbook_name_in_metadata.feature +0 -20
  151. data/features/052_check_for_metadata_using_suggests_keyword.feature +0 -15
  152. data/features/053_check_for_metadata_using_recommends_keyword.feature +0 -15
  153. data/features/055_check_for_no_maintainer.feature +0 -25
  154. data/features/056_check_for_no_maintainer_email.feature +0 -25
  155. data/features/061_valid_cookbook_version_should_be_defined.feature +0 -55
  156. data/features/062_cookbook_should_have_cookbook_version.feature +0 -50
  157. data/features/063_cookbook_incorrectly_depends_on_itself.feature +0 -15
  158. data/features/064_check_for_no_issues_url.feature +0 -25
  159. data/features/065_check_for_no_source_url.feature +0 -25
  160. data/features/066_check_for_no_chef_version_metadata.feature +0 -20
  161. data/features/067_check_for_no_supports_metadata.feature +0 -20
  162. data/features/068_check_for_no_license_metadata.feature +0 -20
  163. data/spec/foodcritic/command_line_spec.rb +0 -74
  164. data/spec/regression/expected-output.txt +0 -355
  165. data/spec/regression_helpers.rb +0 -37
@@ -1,18 +0,0 @@
1
- Feature: Check for no leading cookbook name
2
-
3
- In order to ensure cookbook recipes are correctly listed
4
- As a developer
5
- I want to identify recipes defined in metadata that do not include the leading cookbook name
6
-
7
- Scenario Outline: Recipe declaration in metadata
8
- Given a cookbook with metadata that declares a recipe with <declaration>
9
- When I check the cookbook
10
- Then the no leading cookbook name warning 029 should be <show_warning>
11
-
12
- Examples:
13
- | declaration | show_warning |
14
- | recipe "example", "Installs Example" | not shown |
15
- | recipe "example::default", "Installs Example" | not shown |
16
- | recipe "default", "Installs Example" | shown |
17
- | recipe my_var, "Installs Example" | not shown |
18
- | recipe "#{my_var}::default", "Installs Example" | not shown |
@@ -1,15 +0,0 @@
1
- Feature: Check for metadata existence
2
-
3
- In order to ensure that cookbook has the minimum
4
- As a developer
5
- I want to verify that the metadata file exist
6
-
7
- Scenario: Cookbook without metadata.rb file
8
- Given a cookbook that does not have defined metadata
9
- When I check the cookbook
10
- Then the non existing metadata warning 031 should be displayed against the metadata file
11
-
12
- Scenario: Cookbook with metadata.rb file
13
- Given a cookbook that has the default boilerplate metadata generated by knife
14
- When I check the cookbook
15
- Then the non existing metadata warning 031 should not be displayed against the metadata file
@@ -1,15 +0,0 @@
1
- Feature: Check for deprecated require recipe
2
-
3
- In order to prevent failure of my cookbooks in future versions of Chef
4
- As a developer
5
- I want to use include_recipe in preference to require_recipe
6
-
7
- Scenario: Recipe uses require_recipe
8
- Given a recipe that uses require_recipe
9
- When I check the cookbook
10
- Then the require_recipe deprecated warning 042 should be displayed
11
-
12
- Scenario: Recipe does not use require_recipe
13
- Given a recipe that uses include_recipe
14
- When I check the cookbook
15
- Then the require_recipe deprecated warning 042 should not be displayed
@@ -1,20 +0,0 @@
1
- Feature: Check for cookbook name in metadata
2
-
3
- In order to avoid complications where a cookbook repository name differs from the cookbook name
4
- As a developer
5
- I want to set the cookbook name within the metadata
6
-
7
- Scenario: Name specified in metadata
8
- Given a cookbook with metadata that specifies the cookbook name
9
- When I check the cookbook
10
- Then the consider setting cookbook name warning 045 should not be displayed against the metadata file
11
-
12
- Scenario: Name not specified in metadata
13
- Given a cookbook with metadata that does not specify the cookbook name
14
- When I check the cookbook
15
- Then the consider setting cookbook name warning 045 should be displayed against the metadata file
16
-
17
- Scenario: No cookbook metadata
18
- Given a cookbook that does not have defined metadata
19
- When I check the cookbook
20
- Then the consider setting cookbook name warning 045 should be displayed against the metadata file
@@ -1,15 +0,0 @@
1
- Feature: Check for metadata using suggests keyword
2
-
3
- In order to ensure that recipe metadata is stable
4
- As a developer
5
- I want to identify metadata that is using unimplemented features whose definitions may change in the future
6
-
7
- Scenario: Metadata with the suggests keyword
8
- Given a cookbook with metadata that includes a suggests keyword
9
- When I check the cookbook
10
- Then the metadata using suggests warning 052 should be shown against the metadata file
11
-
12
- Scenario: Metadata without the suggests keyword
13
- Given a cookbook with metadata that does not include a suggests keyword
14
- When I check the cookbook
15
- Then the metadata using suggests warning 052 should be not shown against the metadata file
@@ -1,15 +0,0 @@
1
- Feature: Check for metadata using recommends keyword
2
-
3
- In order to ensure that recipe metadata is stable
4
- As a developer
5
- I want to identify metadata that is using unimplemented features whose definitions may change in the future
6
-
7
- Scenario: Metadata with the recommends keyword
8
- Given a cookbook with metadata that includes a recommends keyword
9
- When I check the cookbook
10
- Then the metadata using recommends warning 053 should be shown against the metadata file
11
-
12
- Scenario: Metadata without the recommends keyword
13
- Given a cookbook with metadata that does not include a recommends keyword
14
- When I check the cookbook
15
- Then the metadata using recommends warning 053 should be not shown against the metadata file
@@ -1,25 +0,0 @@
1
- Feature: Check for no maintainer
2
-
3
- In order to be able to upload my cookbook
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the maintainer
6
-
7
- Scenario: Metadata without a maintainer
8
- Given a cookbook with metadata that does not include a maintainer keyword
9
- When I check the cookbook
10
- Then the metadata missing maintainer warning 055 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a maintainer
13
- Given a cookbook with metadata that includes a maintainer keyword
14
- When I check the cookbook
15
- Then the metadata missing maintainer warning 055 should be not shown against the metadata file
16
-
17
- Scenario: Metadata with a maintainer that is an expression
18
- Given a cookbook with metadata that includes a maintainer expression
19
- When I check the cookbook
20
- Then the metadata missing maintainer warning 055 should be not shown against the metadata file
21
-
22
- Scenario: Cookbook without metadata file
23
- Given a cookbook that does not have defined metadata
24
- When I check the cookbook
25
- Then the metadata missing maintainer warning 055 should be not shown against the metadata file
@@ -1,25 +0,0 @@
1
- Feature: Check for no maintainer email
2
-
3
- In order to be able to upload my cookbook
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the maintainer email
6
-
7
- Scenario: Metadata without a maintainer email
8
- Given a cookbook with metadata that does not include a maintainer email
9
- When I check the cookbook
10
- Then the metadata missing maintainer email warning 056 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a maintainer email
13
- Given a cookbook with metadata that includes a maintainer email
14
- When I check the cookbook
15
- Then the metadata missing maintainer email warning 056 should be not shown against the metadata file
16
-
17
- Scenario: Metadata with a maintainer email that is an expression
18
- Given a cookbook with metadata that includes a maintainer email expression
19
- When I check the cookbook
20
- Then the metadata missing maintainer email warning 056 should be not shown against the metadata file
21
-
22
- Scenario: Cookbook without metadata file
23
- Given a cookbook that does not have defined metadata
24
- When I check the cookbook
25
- Then the metadata missing maintainer email warning 056 should be not shown against the metadata file
@@ -1,55 +0,0 @@
1
- Feature: Defined cookbook version should be valid
2
-
3
- In order to ensure that recipe metadata is stable
4
- As a developer
5
- I want to identify metadata that does not define a valid version for the cookbook
6
-
7
- Scenario: Metadata with the version keyword and a valid version
8
- Given a cookbook with metadata that includes the version keyword and a valid version string
9
- When I check the cookbook
10
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
11
-
12
- Scenario: Metadata with the version keyword and a valid version with double quotes
13
- Given a cookbook with metadata that includes the version keyword and a valid version string with double quotes
14
- When I check the cookbook
15
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
16
-
17
- Scenario: Metadata with the version keyword and a valid x.y version
18
- Given a cookbook with metadata that includes the version keyword and a valid x.y version string
19
- When I check the cookbook
20
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
21
-
22
- Scenario: Metadata without the version keyword
23
- Given a cookbook with metadata that does not include a version keyword
24
- When I check the cookbook
25
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
26
-
27
- Scenario: Metadata with the version keyword and an invalid version
28
- Given a cookbook with metadata that includes the version keyword and an invalid version string
29
- When I check the cookbook
30
- Then the metadata defines valid version warning 061 should be displayed against the metadata file
31
-
32
- Scenario: Metadata with the version keyword and an invalid single digit version
33
- Given a cookbook with metadata that includes the version keyword and an invalid single digit version string
34
- When I check the cookbook
35
- Then the metadata defines valid version warning 061 should be displayed against the metadata file
36
-
37
- Scenario: Metadata with the version keyword and an invalid 4 digit version
38
- Given a cookbook with metadata that includes the version keyword and an invalid 4 digit version string
39
- When I check the cookbook
40
- Then the metadata defines valid version warning 061 should be displayed against the metadata file
41
-
42
- Scenario: Metadata version that uses string interpolation
43
- Given a cookbook with a metadata version that uses string interpolation
44
- When I check the cookbook
45
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
46
-
47
- Scenario: Metadata version that is not a string literal
48
- Given a cookbook with a metadata version that is not a string literal
49
- When I check the cookbook
50
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
51
-
52
- Scenario: Metadata version that is a method call
53
- Given a cookbook with a metadata version that is a method call
54
- When I check the cookbook
55
- Then the metadata defines valid version warning 061 should not be displayed against the metadata file
@@ -1,50 +0,0 @@
1
- Feature: Cookbook version should be defined
2
-
3
- In order to ensure that recipe metadata is stable
4
- As a developer
5
- I want to identify metadata that does not define any version for a cookbook
6
-
7
- Scenario: Metadata with the version keyword and a valid version
8
- Given a cookbook with metadata that includes the version keyword and a valid version string
9
- When I check the cookbook
10
- Then the metadata without version warning 062 should not be displayed against the metadata file
11
-
12
- Scenario: Metadata with the version keyword and a valid version with double quotes
13
- Given a cookbook with metadata that includes the version keyword and a valid version string with double quotes
14
- When I check the cookbook
15
- Then the metadata without version warning 062 should not be displayed against the metadata file
16
-
17
- Scenario: Metadata with the version keyword and a valid x.y version
18
- Given a cookbook with metadata that includes the version keyword and a valid x.y version string
19
- When I check the cookbook
20
- Then the metadata without version warning 062 should not be displayed against the metadata file
21
-
22
- Scenario: Metadata without the version keyword
23
- Given a cookbook with metadata that does not include a version keyword
24
- When I check the cookbook
25
- Then the metadata without version warning 062 should be displayed against the metadata file
26
-
27
- Scenario: Metadata with the version keyword and an invalid version
28
- Given a cookbook with metadata that includes the version keyword and an invalid version string
29
- When I check the cookbook
30
- Then the metadata without version warning 062 should not be displayed against the metadata file
31
-
32
- Scenario: Metadata with the version keyword and an invalid single digit version
33
- Given a cookbook with metadata that includes the version keyword and an invalid single digit version string
34
- When I check the cookbook
35
- Then the metadata without version warning 062 should not be displayed against the metadata file
36
-
37
- Scenario: Metadata with the version keyword and an invalid 4 digit version
38
- Given a cookbook with metadata that includes the version keyword and an invalid 4 digit version string
39
- When I check the cookbook
40
- Then the metadata without version warning 062 should not be displayed against the metadata file
41
-
42
- Scenario: Metadata version that uses string interpolation' do
43
- Given a cookbook with a metadata version that uses string interpolation
44
- When I check the cookbook
45
- Then the metadata without version warning 062 should not be displayed against the metadata file
46
-
47
- Scenario: Metadata version that is not a string literal' do
48
- Given a cookbook with a metadata version that is not a string literal
49
- When I check the cookbook
50
- Then the metadata without version warning 062 should not be displayed against the metadata file
@@ -1,15 +0,0 @@
1
- Feature: Check for metadata using suggests keyword
2
-
3
- In order to avoid pathological depsolving issues
4
- As a developer
5
- I want to identify cookbooks that depend on themselves and remove that (unnecessary) dependency
6
-
7
- Scenario: Metadata with self dependency
8
- Given a cookbook with metadata that includes a self dependency
9
- When I check the cookbook
10
- Then the metadata with self dependency warning 063 should be shown against the metadata file
11
-
12
- Scenario: Metadata without self dependency
13
- Given a cookbook with metadata that does not include a self dependency
14
- When I check the cookbook
15
- Then the metadata with self dependency warning 063 should be not shown against the metadata file
@@ -1,25 +0,0 @@
1
- Feature: Check for no issues_url
2
-
3
- In order to be able to share my cookbook on the Supermarket
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the issues_url
6
-
7
- Scenario: Metadata without a issues_url
8
- Given a cookbook with metadata that does not include a issues_url keyword
9
- When I check the cookbook
10
- Then the metadata missing issues_url warning 064 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a issues_url
13
- Given a cookbook with metadata that includes a issues_url keyword
14
- When I check the cookbook
15
- Then the metadata missing issues_url warning 064 should be not shown against the metadata file
16
-
17
- Scenario: Metadata with a issues_url that is an expression
18
- Given a cookbook with metadata that includes a issues_url expression
19
- When I check the cookbook
20
- Then the metadata missing issues_url warning 064 should be not shown against the metadata file
21
-
22
- Scenario: Cookbook without metadata file
23
- Given a cookbook that does not have defined metadata
24
- When I check the cookbook
25
- Then the metadata missing issues_url warning 064 should be not shown against the metadata file
@@ -1,25 +0,0 @@
1
- Feature: Check for no source_url
2
-
3
- In order to be able to share my cookbook on the Supermarket
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the source_url
6
-
7
- Scenario: Metadata without a source_url
8
- Given a cookbook with metadata that does not include a source_url keyword
9
- When I check the cookbook
10
- Then the metadata missing source_url warning 065 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a source_url
13
- Given a cookbook with metadata that includes a source_url keyword
14
- When I check the cookbook
15
- Then the metadata missing source_url warning 065 should be not shown against the metadata file
16
-
17
- Scenario: Metadata with a source_url that is an expression
18
- Given a cookbook with metadata that includes a source_url expression
19
- When I check the cookbook
20
- Then the metadata missing source_url warning 065 should be not shown against the metadata file
21
-
22
- Scenario: Cookbook without metadata file
23
- Given a cookbook that does not have defined metadata
24
- When I check the cookbook
25
- Then the metadata missing source_url warning 065 should be not shown against the metadata file
@@ -1,20 +0,0 @@
1
- Feature: Check for no chef_version metadata
2
-
3
- In order to clearly specify chef version compatibility to users
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the chef_version
6
-
7
- Scenario: Metadata without a chef_version
8
- Given a cookbook with metadata that does not include a chef_version keyword
9
- When I check the cookbook
10
- Then the metadata missing chef_version warning 066 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a chef_version
13
- Given a cookbook with metadata that includes a chef_version keyword
14
- When I check the cookbook
15
- Then the metadata missing chef_version warning 066 should be not shown against the metadata file
16
-
17
- Scenario: Cookbook without metadata file
18
- Given a cookbook that does not have defined metadata
19
- When I check the cookbook
20
- Then the metadata missing chef_version warning 066 should be not shown against the metadata file
@@ -1,20 +0,0 @@
1
- Feature: Check for no supports metadata
2
-
3
- In order to clearly specify platform support to users
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the platform supports
6
-
7
- Scenario: Metadata without a supports metadata
8
- Given a cookbook with metadata that does not include a supports keyword
9
- When I check the cookbook
10
- Then the metadata missing supports warning 067 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a supports metadata
13
- Given a cookbook with metadata that includes a supports keyword
14
- When I check the cookbook
15
- Then the metadata missing supports warning 067 should be not shown against the metadata file
16
-
17
- Scenario: Cookbook without metadata file
18
- Given a cookbook that does not have defined metadata
19
- When I check the cookbook
20
- Then the metadata missing supports warning 067 should be not shown against the metadata file
@@ -1,20 +0,0 @@
1
- Feature: Check for no license metadata
2
-
3
- In order to clearly specify cookbook licensing to consumers
4
- As a developer
5
- I want to be notified when my cookbook metadata does not specify the license
6
-
7
- Scenario: Metadata without a license
8
- Given a cookbook with metadata that does not include a license keyword
9
- When I check the cookbook
10
- Then the metadata missing license warning 068 should be shown against the metadata file
11
-
12
- Scenario: Metadata with a license
13
- Given a cookbook with metadata that includes a license keyword
14
- When I check the cookbook
15
- Then the metadata missing license warning 068 should be not shown against the metadata file
16
-
17
- Scenario: Cookbook without metadata file
18
- Given a cookbook that does not have defined metadata
19
- When I check the cookbook
20
- Then the metadata missing license warning 068 should be not shown against the metadata file
@@ -1,74 +0,0 @@
1
- require_relative "../spec_helper"
2
-
3
- describe FoodCritic::CommandLine do
4
- it "is instantiable" do
5
- FoodCritic::CommandLine.new([]).wont_be_nil
6
- end
7
-
8
- describe "#cookbook_paths" do
9
- it "returns an empty array if no paths are specified" do
10
- FoodCritic::CommandLine.new([]).cookbook_paths.must_be_empty
11
- end
12
-
13
- it "returns a single item array for a specified directory" do
14
- FoodCritic::CommandLine.new(["example"]).cookbook_paths.must_equal ["example"]
15
- end
16
-
17
- it "returns multiple items for multiple specified directories" do
18
- FoodCritic::CommandLine.new(%w{example another_example}).cookbook_paths.must_equal %w{example another_example}
19
- end
20
-
21
- it "ignores known arguments" do
22
- FoodCritic::CommandLine.new(["example", "--context"]).cookbook_paths.must_equal ["example"]
23
- end
24
- end
25
-
26
- describe "#role_paths" do
27
- it "returns an empty if no role paths are specified" do
28
- FoodCritic::CommandLine.new([]).role_paths.must_be_empty
29
- end
30
- it "returns the provided role path" do
31
- FoodCritic::CommandLine.new(["-R", "roles"]).role_paths.must_equal(%w{roles})
32
- end
33
- it "returns the provided role paths when there are multiple" do
34
- FoodCritic::CommandLine.new(["-R", "roles1",
35
- "-R", "roles2"]).role_paths.must_equal(%w{roles1 roles2})
36
- end
37
- end
38
-
39
- describe "#valid_paths?" do
40
- it "returns false if no paths are specified" do
41
- refute FoodCritic::CommandLine.new([]).valid_paths?
42
- end
43
-
44
- it "returns true if the specified directory exists" do
45
- assert FoodCritic::CommandLine.new(["lib"]).valid_paths?
46
- end
47
-
48
- it "returns false if the specified directory does not exist" do
49
- refute FoodCritic::CommandLine.new(["lib2"]).valid_paths?
50
- end
51
-
52
- it "returns true if the specified file exists" do
53
- assert FoodCritic::CommandLine.new(["lib/foodcritic.rb"]).valid_paths?
54
- end
55
-
56
- it "returns true if both specified paths exist" do
57
- assert FoodCritic::CommandLine.new(["lib", "lib/foodcritic.rb"]).valid_paths?
58
- end
59
-
60
- it "returns false if any on the specified paths do not exist" do
61
- refute FoodCritic::CommandLine.new(%w{lib lib2}).valid_paths?
62
- end
63
- end
64
-
65
- describe "#list_rules?" do
66
- it "returns false if ---list is not specified" do
67
- refute FoodCritic::CommandLine.new([]).list_rules?
68
- end
69
-
70
- it "returns true if --list is specified" do
71
- assert FoodCritic::CommandLine.new(["--list"]).list_rules?
72
- end
73
- end
74
- end