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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.2.2
4
+ version: 10.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-core
@@ -114,6 +114,48 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '1.0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rspec
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '3.5'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '3.5'
131
+ - !ruby/object:Gem::Dependency
132
+ name: fuubar
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '2.0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '2.0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: rspec-command
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '1.0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1.0'
117
159
  description: Lint tool for Chef cookbooks.
118
160
  email:
119
161
  executables:
@@ -141,21 +183,16 @@ files:
141
183
  - chef_dsl_metadata/chef_12.7.2.json
142
184
  - chef_dsl_metadata/chef_12.8.1.json
143
185
  - chef_dsl_metadata/chef_12.9.38.json
144
- - features/001_check_node_access.feature
145
186
  - features/002_check_string_interpolation.feature
146
187
  - features/004_check_service_resource_used.feature
147
188
  - features/005_check_for_resource_repetition.feature
148
189
  - features/006_check_file_mode.feature
149
190
  - features/007_check_for_undeclared_recipe_dependencies.feature
150
- - features/008_check_for_boilerplate_metadata.feature
151
191
  - features/009_check_for_unrecognised_resource_attributes.feature
152
192
  - features/010_check_search_syntax.feature
153
- - features/011_check_for_markdown_readme.feature
154
- - features/012_check_for_deprecated_readme_format.feature
155
193
  - features/013_check_for_hardcoded_tmpdir.feature
156
194
  - features/014_check_for_long_ruby_blocks.feature
157
195
  - features/015_check_for_definitions.feature
158
- - features/016_check_for_no_lwrp_default_action.feature
159
196
  - features/017_check_for_no_lwrp_notifications.feature
160
197
  - features/018_check_for_old_lwrp_notification_syntax.feature
161
198
  - features/019_check_for_consistent_node_access.feature
@@ -165,10 +202,7 @@ files:
165
202
  - features/025_check_for_deprecated_gem_install.feature
166
203
  - features/026_check_for_conditional_block_string.feature
167
204
  - features/027_check_for_internal_attribute_use.feature
168
- - features/028_check_for_incorrect_platform_method.feature
169
- - features/029_check_for_no_leading_cookbook_name.feature
170
205
  - features/030_check_for_debugger_breakpoints.feature
171
- - features/031_check_for_metadata_existence.feature
172
206
  - features/032_check_for_invalid_notification_timing.feature
173
207
  - features/033_check_for_missing_template.feature
174
208
  - features/034_check_for_unused_template_variables.feature
@@ -177,32 +211,18 @@ files:
177
211
  - features/039_check_for_key_access_to_node_methods.feature
178
212
  - features/040_check_raw_git_usage.feature
179
213
  - features/041_check_raw_download.feature
180
- - features/042_check_for_deprecated_require_recipe.feature
181
214
  - features/043_check_for_old_notification_style.feature
182
215
  - features/044_check_for_bare_attribute_keys.feature
183
- - features/045_check_for_cookbook_name_in_metadata.feature
184
216
  - features/046_check_for_assign_unless_nil_attributes.feature
185
217
  - features/047_check_for_attribute_assignment_without_precedence.feature
186
218
  - features/048_check_for_shellout.feature
187
219
  - features/049_check_for_role_name_mismatch_with_file_name.feature
188
220
  - features/050_check_for_invalid_name.feature
189
221
  - features/051_check_for_template_partial_loops.feature
190
- - features/052_check_for_metadata_using_suggests_keyword.feature
191
- - features/053_check_for_metadata_using_recommends_keyword.feature
192
- - features/055_check_for_no_maintainer.feature
193
- - features/056_check_for_no_maintainer_email.feature
194
222
  - features/057_check_for_library_provider_without_use_inline_resources.feature
195
223
  - features/058_check_for_library_provider_bad_action_methods.feature
196
224
  - features/059_check_for_lwrp_provider_without_use_inline_resources.feature
197
225
  - features/060_check_for_lwrp_provider_bad_action_methods.feature
198
- - features/061_valid_cookbook_version_should_be_defined.feature
199
- - features/062_cookbook_should_have_cookbook_version.feature
200
- - features/063_cookbook_incorrectly_depends_on_itself.feature
201
- - features/064_check_for_no_issues_url.feature
202
- - features/065_check_for_no_source_url.feature
203
- - features/066_check_for_no_chef_version_metadata.feature
204
- - features/067_check_for_no_supports_metadata.feature
205
- - features/068_check_for_no_license_metadata.feature
206
226
  - features/build_framework_support.feature
207
227
  - features/checking_all_types_of_file.feature
208
228
  - features/choose_rules_to_apply.feature
@@ -296,15 +316,19 @@ files:
296
316
  - lib/foodcritic/rules/fc066.rb
297
317
  - lib/foodcritic/rules/fc067.rb
298
318
  - lib/foodcritic/rules/fc068.rb
319
+ - lib/foodcritic/rules/fc069.rb
320
+ - lib/foodcritic/rules/fc070.rb
321
+ - lib/foodcritic/rules/fc071.rb
322
+ - lib/foodcritic/rules/fc072.rb
323
+ - lib/foodcritic/rules/fc073.rb
324
+ - lib/foodcritic/rules/fc074.rb
325
+ - lib/foodcritic/rules/fc075.rb
299
326
  - lib/foodcritic/template.rb
300
327
  - lib/foodcritic/version.rb
301
328
  - lib/foodcritic/xml.rb
302
329
  - man/foodcritic.1
303
330
  - man/foodcritic.1.ronn
304
331
  - misc/lucene.treetop
305
- - spec/foodcritic/api_spec.rb
306
- - spec/foodcritic/chef_spec.rb
307
- - spec/foodcritic/command_line_spec.rb
308
332
  - spec/foodcritic/coverage/assets/0.10.0/application.css
309
333
  - spec/foodcritic/coverage/assets/0.10.0/application.js
310
334
  - spec/foodcritic/coverage/assets/0.10.0/colorbox/border.png
@@ -330,14 +354,118 @@ files:
330
354
  - spec/foodcritic/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png
331
355
  - spec/foodcritic/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png
332
356
  - spec/foodcritic/coverage/index.html
333
- - spec/foodcritic/domain_spec.rb
334
- - spec/foodcritic/linter_spec.rb
335
- - spec/foodcritic/template_spec.rb
357
+ - spec/functional/fc001_spec.rb
358
+ - spec/functional/fc008_spec.rb
359
+ - spec/functional/fc011_spec.rb
360
+ - spec/functional/fc012_spec.rb
361
+ - spec/functional/fc016_spec.rb
362
+ - spec/functional/fc028_spec.rb
363
+ - spec/functional/fc029_spec.rb
364
+ - spec/functional/fc031_spec.rb
365
+ - spec/functional/fc042_spec.rb
366
+ - spec/functional/fc045_spec.rb
367
+ - spec/functional/fc052_spec.rb
368
+ - spec/functional/fc053_spec.rb
369
+ - spec/functional/fc055_spec.rb
370
+ - spec/functional/fc056_spec.rb
371
+ - spec/functional/fc061_spec.rb
372
+ - spec/functional/fc062_spec.rb
373
+ - spec/functional/fc063_spec.rb
374
+ - spec/functional/fc064_spec.rb
375
+ - spec/functional/fc065_spec.rb
376
+ - spec/functional/fc066_spec.rb
377
+ - spec/functional/fc067_spec.rb
378
+ - spec/functional/fc068_spec.rb
379
+ - spec/functional/fc069_spec.rb
380
+ - spec/functional/fc070_spec.rb
381
+ - spec/functional/fc071_spec.rb
382
+ - spec/functional/fc072_spec.rb
383
+ - spec/functional/fc073_spec.rb
384
+ - spec/functional/fc074_spec.rb
385
+ - spec/functional/fc075_spec.rb
386
+ - spec/functional/root_aliases_spec.rb
336
387
  - spec/regression/cookbooks.txt
337
- - spec/regression/expected-output.txt
388
+ - spec/regression/expected/activemq.txt
389
+ - spec/regression/expected/apparmor.txt
390
+ - spec/regression/expected/apt.txt
391
+ - spec/regression/expected/aws.txt
392
+ - spec/regression/expected/bluepill.txt
393
+ - spec/regression/expected/boost.txt
394
+ - spec/regression/expected/build-essential.txt
395
+ - spec/regression/expected/chef-client.txt
396
+ - spec/regression/expected/chef-server.txt
397
+ - spec/regression/expected/chef.txt
398
+ - spec/regression/expected/chef_handler.txt
399
+ - spec/regression/expected/cron.txt
400
+ - spec/regression/expected/database.txt
401
+ - spec/regression/expected/dmg.txt
402
+ - spec/regression/expected/drbd.txt
403
+ - spec/regression/expected/dynect.txt
404
+ - spec/regression/expected/erlang.txt
405
+ - spec/regression/expected/fail2ban.txt
406
+ - spec/regression/expected/firewall.txt
407
+ - spec/regression/expected/gecode.txt
408
+ - spec/regression/expected/gems.txt
409
+ - spec/regression/expected/gunicorn.txt
410
+ - spec/regression/expected/heartbeat.txt
411
+ - spec/regression/expected/homebrew.txt
412
+ - spec/regression/expected/iis.txt
413
+ - spec/regression/expected/iptables.txt
414
+ - spec/regression/expected/jetty.txt
415
+ - spec/regression/expected/jpackage.txt
416
+ - spec/regression/expected/keepalived.txt
417
+ - spec/regression/expected/kickstart.txt
418
+ - spec/regression/expected/logwatch.txt
419
+ - spec/regression/expected/lvm.txt
420
+ - spec/regression/expected/maradns.txt
421
+ - spec/regression/expected/maven.txt
422
+ - spec/regression/expected/memcached.txt
423
+ - spec/regression/expected/motd-tail.txt
424
+ - spec/regression/expected/mysql.txt
425
+ - spec/regression/expected/ohai.txt
426
+ - spec/regression/expected/openldap.txt
427
+ - spec/regression/expected/openssh.txt
428
+ - spec/regression/expected/openssl.txt
429
+ - spec/regression/expected/partial_search.txt
430
+ - spec/regression/expected/passenger_apache2.txt
431
+ - spec/regression/expected/perl.txt
432
+ - spec/regression/expected/php.txt
433
+ - spec/regression/expected/postfix.txt
434
+ - spec/regression/expected/powershell.txt
435
+ - spec/regression/expected/resolver.txt
436
+ - spec/regression/expected/rsync.txt
437
+ - spec/regression/expected/rsyslog.txt
438
+ - spec/regression/expected/sql_server.txt
439
+ - spec/regression/expected/sqlite.txt
440
+ - spec/regression/expected/ssh_known_hosts.txt
441
+ - spec/regression/expected/stompserver.txt
442
+ - spec/regression/expected/subversion.txt
443
+ - spec/regression/expected/sudo.txt
444
+ - spec/regression/expected/tftp.txt
445
+ - spec/regression/expected/tomcat.txt
446
+ - spec/regression/expected/transmission.txt
447
+ - spec/regression/expected/ubuntu.txt
448
+ - spec/regression/expected/ufw.txt
449
+ - spec/regression/expected/unicorn.txt
450
+ - spec/regression/expected/users.txt
451
+ - spec/regression/expected/vim.txt
452
+ - spec/regression/expected/webpi.txt
453
+ - spec/regression/expected/whitelist-node-attrs.txt
454
+ - spec/regression/expected/windows.txt
455
+ - spec/regression/expected/wix.txt
456
+ - spec/regression/expected/xfs.txt
457
+ - spec/regression/expected/xml.txt
458
+ - spec/regression/expected/yum.txt
459
+ - spec/regression/expected/zlib.txt
460
+ - spec/regression/expected/zsh.txt
338
461
  - spec/regression/regression_spec.rb
339
- - spec/regression_helpers.rb
340
462
  - spec/spec_helper.rb
463
+ - spec/unit/api_spec.rb
464
+ - spec/unit/chef_spec.rb
465
+ - spec/unit/command_line_spec.rb
466
+ - spec/unit/domain_spec.rb
467
+ - spec/unit/linter_spec.rb
468
+ - spec/unit/template_spec.rb
341
469
  homepage: http://foodcritic.io
342
470
  licenses:
343
471
  - MIT
@@ -361,5 +489,5 @@ rubyforge_project:
361
489
  rubygems_version: 2.6.11
362
490
  signing_key:
363
491
  specification_version: 4
364
- summary: foodcritic-10.2.2
492
+ summary: foodcritic-10.3.0
365
493
  test_files: []
@@ -1,60 +0,0 @@
1
- Feature: Check Node Access
2
-
3
- In order to be consistent in the way I access node attributes and to avoid confusing people new to Ruby
4
- As a developer
5
- I want to identify if the cookbooks access node attributes with symbols rather than strings
6
-
7
- Scenario: Cookbook recipe accesses attributes via symbols
8
- Given a cookbook with a single recipe that reads node attributes via symbols
9
- When I check the cookbook
10
- Then the node access warning 001 should be displayed
11
-
12
- Scenario: Cookbook recipe accesses multiple attributes via symbols
13
- Given a cookbook with a single recipe that accesses multiple node attributes via symbols
14
- When I check the cookbook
15
- Then the node access warning 001 should be displayed for each match
16
-
17
- Scenario: Assignment of node attributes accessed via symbols
18
- Given a cookbook with a single recipe that assigns node attributes accessed via symbols to a local variable
19
- When I check the cookbook
20
- Then the node access warning 001 should be displayed
21
-
22
- Scenario: Cookbook recipe accesses nested attributes via symbols
23
- Given a cookbook with a single recipe that accesses nested node attributes via symbols
24
- When I check the cookbook
25
- Then the node access warning 001 should be displayed twice for the same line
26
-
27
- Scenario: Cookbook recipe accesses attributes via strings
28
- Given a cookbook with a single recipe that reads node attributes via strings
29
- When I check the cookbook
30
- Then the node access warning 001 should not be displayed
31
-
32
- Scenario: Cookbook recipe access attributes via strings and searches
33
- Given a cookbook with a single recipe that searches based on a node attribute accessed via strings
34
- When I check the cookbook
35
- Then the node access warning 001 should not be displayed
36
-
37
- Scenario: Cookbook recipe access attributes via symbols for template
38
- Given a cookbook with a single recipe that passes node attributes accessed via symbols to a template
39
- When I check the cookbook
40
- Then the node access warning 001 should be displayed against the variables
41
-
42
- Scenario: Cookbook recipe sets default attributes via symbols
43
- Given a cookbook that declares default attributes via symbols
44
- When I check the cookbook
45
- Then the node access warning 001 should be displayed against the attributes file
46
-
47
- Scenario: Cookbook recipe overrides attributes via symbols
48
- Given a cookbook that declares override attributes via symbols
49
- When I check the cookbook
50
- Then the node access warning 001 should be displayed against the attributes file
51
-
52
- Scenario: Cookbook recipe sets attributes via symbols
53
- Given a cookbook that declares set attributes via symbols
54
- When I check the cookbook
55
- Then the node access warning 001 should be displayed against the attributes file
56
-
57
- Scenario: Cookbook recipe sets normal attributes via symbols
58
- Given a cookbook that declares normal attributes via symbols
59
- When I check the cookbook
60
- Then the node access warning 001 should be displayed against the attributes file
@@ -1,25 +0,0 @@
1
- Feature: Check for boilerplate metadata
2
-
3
- In order to ensure that recipe metadata is accurate
4
- As a developer
5
- I want to identify metadata that has not been changed from the generated defaults
6
-
7
- Scenario: Unmodified knife generated metadata
8
- Given a cookbook that has the default boilerplate metadata generated by knife
9
- When I check the cookbook
10
- Then the boilerplate metadata warning 008 should be displayed against the metadata file
11
-
12
- Scenario Outline: Boilerplate maintainer metadata
13
- Given a cookbook that has maintainer metadata set to <maintainer> and <maintainer_email>
14
- When I check the cookbook
15
- Then the boilerplate metadata warning 008 should warn on lines <lines>
16
-
17
- Examples:
18
- | maintainer | maintainer_email | lines |
19
- | unspecified | unspecified | |
20
- | YOUR_COMPANY_NAME | unspecified | 1 |
21
- | unspecified | YOUR_EMAIL | 1 |
22
- | YOUR_COMPANY_NAME | foo@example.com | 1 |
23
- | Example Ltd | YOUR_EMAIL | 2 |
24
- | YOUR_COMPANY_NAME | YOUR_EMAIL | 1,2 |
25
- | Example Ltd | foo@example.com | |
@@ -1,20 +0,0 @@
1
- Feature: Check for markdown readme
2
-
3
- In order to ensure that my cookbook README renders nicely on Supermarket
4
- As a developer
5
- I want to identify if my cookbook does not have a markdown formatted README
6
-
7
- Scenario: Cookbook missing markdown formatted README
8
- Given a cookbook that does not have a README at all
9
- When I check the cookbook
10
- Then the missing readme warning 011 should be displayed against the README.md file
11
-
12
- Scenario: Cookbook has markdown formatted README
13
- Given a cookbook that has a README in markdown format
14
- When I check the cookbook
15
- Then the missing readme warning 011 should not be displayed against the README.md file
16
-
17
- Scenario: Cookbook has an alternatively formatted README
18
- Given a cookbook that has a README in RDoc format
19
- When I check the cookbook
20
- Then the missing readme warning 011 should be displayed against the README.md file
@@ -1,20 +0,0 @@
1
- Feature: Check for deprecated README format
2
-
3
- In order to ensure that my cookbook README renders nicely on Supermarket
4
- As a developer
5
- I want to identify if my cookbook is using an older-style RDoc format that needs converting
6
-
7
- Scenario: Cookbook missing RDoc formatted README
8
- Given a cookbook that does not have a README at all
9
- When I check the cookbook
10
- Then the deprecated format warning 012 should not be displayed against the README.rdoc file
11
-
12
- Scenario: Cookbook has RDoc formatted README
13
- Given a cookbook that has a README in RDoc format
14
- When I check the cookbook
15
- Then the deprecated format warning 012 should be displayed against the README.rdoc file
16
-
17
- Scenario: Cookbook has an alternatively formatted README
18
- Given a cookbook that has a README in markdown format
19
- When I check the cookbook
20
- Then the deprecated format warning 012 should not be displayed against the README.rdoc file
@@ -1,25 +0,0 @@
1
- Feature: Check for no LWRP default action
2
-
3
- In order to avoid wondering why a LWRP is not taking action
4
- As a developer
5
- I want to identify when a LWRP does not declare a default action
6
-
7
- Scenario: LWRP with no default action
8
- Given a cookbook that contains a LWRP with no default action
9
- When I check the cookbook
10
- Then the LWRP has no default action warning 016 should be displayed against the resource file
11
-
12
- Scenario: LWRP with a default action
13
- Given a cookbook that contains a LWRP with a default action
14
- When I check the cookbook
15
- Then the LWRP has no default action warning 016 should not be displayed against the resource file
16
-
17
- Scenario: LWRP with a default action (pre-DSL)
18
- Given a cookbook that contains a LWRP with a default action defined via a constructor
19
- When I check the cookbook
20
- Then the LWRP has no default action warning 016 should not be displayed against the resource file
21
-
22
- Scenario: Custom resource with no default action
23
- Given a cookbook that contains a custom resource with no default action
24
- When I check the cookbook
25
- Then the LWRP has no default action warning 016 should not be displayed against the resource file
@@ -1,20 +0,0 @@
1
- Feature: Check for incorrect platform method usage
2
-
3
- In order to avoid running code intended for another platform
4
- As a developer
5
- I want to identify conditionals that wrongly use node.platform?
6
-
7
- Scenario Outline: Platform conditionals
8
- Given a cookbook recipe that wraps a platform-specific resource in a <conditional> conditional
9
- When I check the cookbook
10
- Then the incorrect platform usage warning 028 should be <show_warning>
11
-
12
- Examples:
13
- | conditional | show_warning |
14
- | platform? 'linux' | not shown |
15
- | platform?('linux') | not shown |
16
- | platform?('linux', 'mac_os_x') | not shown |
17
- | node.platform? 'linux' | shown |
18
- | node.platform?('linux') | shown |
19
- | node.platform?('linux', 'mac_os_x') | shown |
20
- | node.platform == 'linux' | not shown |