foodcritic 12.2.1 → 12.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d7566bbb8e6c6bf3c8f3410e1a2bfc884becee4
4
- data.tar.gz: f0e32659516e8f0f191fe0790626b3a6e073694f
3
+ metadata.gz: 4cca4b9220b37c61b2a6787963597afc99c36c91
4
+ data.tar.gz: 3efa091b16afb38ed2ba05425ac378ca410cb450
5
5
  SHA512:
6
- metadata.gz: da2b94c491d43fefed96decc3e375652d478856fef5ce9a770aa935524ba6f2c98ff28a5e2324de20f2e260241be36a3cba0a7264fa465d874a008b54b4b2c0a
7
- data.tar.gz: 2da6b12cba8bc43443d6ca5cd888e1d433f595eacd9aa7d1824c0b7eceb2eed010365e5d59058755d07682a37ea6c921a531065395178ebb050e8a42ee474d7a
6
+ metadata.gz: 22978558516fe2c9f8880ccd148155070d88ae8457c4861bf13b8963dcacd5a8dc12c85f4de74bedb564611765c3f980703365826bb3e45da6ab38a0c1b93df6
7
+ data.tar.gz: 46a58bedda591bf9ab373b56229d76173b11b4a8b5e7173b8b4eda45799616e02df3d090448ce376079d7d3763504092d0ef6a57c4cd257aa1aa3a1f4f381c8c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Foodcritic Changelog:
2
2
 
3
- ## [12.2.1](https://github.com/Foodcritic/foodcritic/tree/v12.2.0) (2017-11-14)
3
+ ## [12.2.2](https://github.com/Foodcritic/foodcritic/tree/v12.2.2) (2017-12-13)
4
+
5
+ **Fixed bugs:**
6
+
7
+ - Don't require a space before the # in an ignore comment.
8
+ - FC009 should not alert on a raise in a resource
9
+ - Catch systemd service starts in FC004 and resolve several false positives
10
+
11
+ ## [12.2.1](https://github.com/Foodcritic/foodcritic/tree/v12.2.1) (2017-11-14)
4
12
 
5
13
  **Fixed bugs:**
6
14
 
@@ -46,7 +46,7 @@ Feature: Ignoring rules on per line basis
46
46
  Examples:
47
47
  | comment | warnings |
48
48
  | | FC002,FC039 |
49
- | # ~FC002,~FC007 | FC002 |
49
+ | # ~FC002,~FC007 | FC039 |
50
50
  | # ~FC002,~FC039 | |
51
51
  | # ~FC002 | FC039 |
52
52
 
@@ -339,22 +339,6 @@ module FoodCritic
339
339
  }
340
340
  end
341
341
 
342
- # Create a recipe that controls a service using the specified method.
343
- #
344
- # @param [Symbol] method How to start the service, one of: :init_d, :invoke_rc_d, :upstart, :service, :service_full_path.
345
- # @param [Boolean] do_sleep Whether to prefix the service cmd with a bash sleep
346
- # @param [Symbol] action The action to take (start, stop, reload, restart)
347
- def recipe_controls_service(method = :service, do_sleep = false, action = :start)
348
- cmds = { :init_d => "/etc/init.d/foo #{action}", :invoke_rc_d => "invoke-rc.d foo #{action}", :upstart => "#{action} foo",
349
- :service => "service foo #{action}", :service_full_path => "/sbin/service foo #{action}" }
350
- write_recipe %Q{
351
- execute "#{action}-foo-service" do
352
- command "#{do_sleep ? 'sleep 5; ' : ''}#{cmds[method]}"
353
- action :run
354
- end
355
- }
356
- end
357
-
358
342
  # Create a recipe with an external dependency on another cookbook.
359
343
  #
360
344
  # @param [Hash] dep The options to use for dependency
@@ -13,7 +13,7 @@ module FoodCritic
13
13
  attr_reader :chef_version
14
14
 
15
15
  # Perform a lint check. This method is intended for use by the command-line
16
- # wrapper. If you are programatically using foodcritic you should use
16
+ # wrapper. If you are programmatically using foodcritic you should use
17
17
  # `#check` below.
18
18
  def self.run(cmd_line)
19
19
  # The first item is the string output, the second is exit code.
@@ -183,7 +183,7 @@ module FoodCritic
183
183
  end
184
184
 
185
185
  def ignore_line_match?(line, rule)
186
- ignores = line.to_s[/\s+#\s*(.*)/, 1]
186
+ ignores = line.to_s[/.*#\s*(.*)/, 1]
187
187
  if ignores && ignores.include?("~")
188
188
  !rule.matches_tags?(ignores.split(/[ ,]/))
189
189
  else
@@ -3,10 +3,11 @@ rule "FC004", "Use a service resource to start and stop services" do
3
3
  recipe do |ast|
4
4
  find_resources(ast, type: "execute").find_all do |cmd|
5
5
  cmd_str = (resource_attribute(cmd, "command") || resource_name(cmd)).to_s
6
- (cmd_str.include?("/etc/init.d") || ["service ", "/sbin/service ",
7
- "start ", "stop ", "invoke-rc.d "].any? do |service_cmd|
8
- cmd_str.start_with?(service_cmd)
9
- end) && %w{start stop restart reload}.any? { |a| cmd_str.include?(a) }
6
+ next if cmd_str.include?(".exe") # don't catch windows commands
7
+ cmd_str.start_with?( "start ", "stop ", "reload ", "restart ") || # upstart jobs
8
+ ( [ "/etc/init.d", "service ", "/sbin/service ", "invoke-rc.d ", "systemctl "].any? do |service_cmd| # upstart / sys-v / systemd
9
+ cmd_str.start_with?(service_cmd)
10
+ end && [" start", " stop", " restart", " reload"].any? { |a| cmd_str.include?(a) } ) # make sure we get exactly the commands not something like 'daemon-reload'
10
11
  end
11
12
  end
12
13
  end
@@ -5,7 +5,9 @@ rule "FC009", "Resource attribute not recognised" do
5
5
  resource_attributes_by_type(ast).each do |type, resources|
6
6
  resources.each do |resource|
7
7
  resource.keys.map(&:to_sym).reject do |att|
8
- resource_attribute?(type.to_sym, att)
8
+ # look up the resource attribute give it's type (file, package, etc)
9
+ # raise is a special case. It's questionable, but shouldn't alert
10
+ resource_attribute?(type.to_sym, att) || att == :raise
9
11
  end.each do |invalid_att|
10
12
  matches << find_resources(ast, type: type).find do |res|
11
13
  resource_attributes(res).include?(invalid_att.to_s)
@@ -4,7 +4,7 @@ rule "FC108", "Resource should not define a property named 'name'" do
4
4
  # Make sure we're in a custom resource not an LWRP
5
5
  if ast.xpath("//command/ident/@value='action'")
6
6
  # command has a child of type ident with a value of "property". That tells us
7
- # we're in a property. Quite a ways desecendant from that is another ident
7
+ # we're in a property. Quite a ways descendant from that is another ident
8
8
  # with value of "name"
9
9
  ast.xpath("//command[ident/@value='property' and descendant::symbol_literal/symbol/ident/@value='name']")
10
10
  end
@@ -1,4 +1,4 @@
1
1
  module FoodCritic
2
2
  # The current version of foodcritic
3
- VERSION = "12.2.1"
3
+ VERSION = "12.2.2"
4
4
  end
@@ -0,0 +1,84 @@
1
+ require "spec_helper"
2
+
3
+ describe "FC004" do
4
+ context "using a execute to run a service init script" do
5
+ recipe_file <<-EOH
6
+ execute 'service stuff' do
7
+ command '/etc/init.d/foo start'
8
+ action :run
9
+ end
10
+ EOH
11
+ it { is_expected.to violate_rule }
12
+ end
13
+
14
+ context "using a execute to run a invoke-rc.d" do
15
+ recipe_file <<-EOH
16
+ execute 'service stuff' do
17
+ command 'invoke-rc.d foo restart'
18
+ action :run
19
+ end
20
+ EOH
21
+ it { is_expected.to violate_rule }
22
+ end
23
+
24
+ %w{reload start stop restart}.each do |command|
25
+ context "using a execute to run an upstart #{command} command" do
26
+ recipe_file <<-EOH
27
+ execute 'service stuff' do
28
+ command "#{command} foo"
29
+ action :run
30
+ end
31
+ EOH
32
+ it { is_expected.to violate_rule }
33
+ end
34
+
35
+ context "using a execute to run the upstart service command to #{command}" do
36
+ recipe_file <<-EOH
37
+ execute 'service stuff' do
38
+ command "service foo #{command}"
39
+ action :run
40
+ end
41
+ EOH
42
+ it { is_expected.to violate_rule }
43
+ end
44
+
45
+ context "using a execute to run systemcl to #{command}" do
46
+ recipe_file <<-EOH
47
+ execute 'service stuff' do
48
+ command "systemctl #{command} foo"
49
+ action :run
50
+ end
51
+ EOH
52
+ it { is_expected.to violate_rule }
53
+ end
54
+ end
55
+
56
+ context "using a execute to run a windows start command" do
57
+ recipe_file <<-EOH
58
+ execute 'Run setup' do
59
+ command 'start /wait my_setup.exe --silent'
60
+ end
61
+ EOH
62
+ it { is_expected.not_to violate_rule }
63
+ end
64
+
65
+ context "using a execute to run systemctl daemon-reload" do
66
+ recipe_file <<-EOH
67
+ execute 'Run setup' do
68
+ command 'systemctl daemon-reload'
69
+ end
70
+ EOH
71
+ it { is_expected.not_to violate_rule }
72
+ end
73
+
74
+ context "using a execute to run check the contents of an init script" do
75
+ recipe_file <<-EOH
76
+ execute "Configure the scheduler" do
77
+ user "root"
78
+ command 'sed -i "s/\([^/]\)ondemand/\1performace/g" /etc/init.d/ondemand'
79
+ notifies :start, "service[ondemand]"
80
+ end
81
+ EOH
82
+ it { is_expected.not_to violate_rule }
83
+ end
84
+ end
@@ -24,4 +24,19 @@ describe "FC009" do
24
24
  EOH
25
25
  it { is_expected.to violate_rule }
26
26
  end
27
+
28
+ context "when the resource attribute is actually a raise" do
29
+ foodcritic_command("--chef-version", "12.18.31", "--no-progress", ".")
30
+ recipe_file <<-EOH
31
+ package package_name do
32
+ provider case node["platform_family"]
33
+ when "debian"; Chef::Provider::Package::Dpkg
34
+ when "rhel"; Chef::Provider::Package::Rpm
35
+ else
36
+ raise RuntimeError("I don't know how to install chef-server packages for this platform family")
37
+ end
38
+ end
39
+ EOH
40
+ it { is_expected.not_to violate_rule }
41
+ end
27
42
  end
@@ -24,4 +24,16 @@ describe "FC059" do
24
24
  EOF
25
25
  it { is_expected.not_to violate_rule }
26
26
  end
27
+
28
+ context "with a cookbook ignoring the rule" do
29
+ provider_file <<-EOF.gsub(/^ /, "") # When we drop 2.2 support, this can use <<~EOF.
30
+ # ~FC059
31
+ action :create do
32
+ template "/etc/something.conf" do
33
+ notifies :restart, "service[something]"
34
+ end
35
+ end
36
+ EOF
37
+ it { is_expected.not_to violate_rule }
38
+ end
27
39
  end
@@ -14,3 +14,4 @@ FC070: Ensure supports metadata defines valid platforms: ./metadata.rb:1
14
14
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
15
15
  FC082: Deprecated node.set or node.set_unless used to set node attributes: ./recipes/service.rb:59
16
16
  FC082: Deprecated node.set or node.set_unless used to set node attributes: ./recipes/task.rb:49
17
+ FC104: Use the :run action in ruby_block instead of :create: ./recipes/config.rb:78
@@ -1,3 +1,4 @@
1
1
  FC067: Ensure at least one platform supported in metadata: ./metadata.rb:1
2
2
  FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
3
3
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
4
+ FC109: Use platform-specific package resources instead of provider property: ./libraries/default_handler.rb:52
@@ -2,7 +2,6 @@ FC001: Use strings in preference to symbols to access node attributes: ./librari
2
2
  FC001: Use strings in preference to symbols to access node attributes: ./libraries/omnitruck_client.rb:77
3
3
  FC001: Use strings in preference to symbols to access node attributes: ./libraries/omnitruck_client.rb:78
4
4
  FC007: Ensure recipe dependencies are reflected in cookbook metadata: ./recipes/dev.rb:16
5
- FC009: Resource attribute not recognised: ./recipes/default.rb:46
6
5
  FC019: Access node attributes in a consistent manner: ./libraries/omnitruck_client.rb:76
7
6
  FC019: Access node attributes in a consistent manner: ./libraries/omnitruck_client.rb:77
8
7
  FC019: Access node attributes in a consistent manner: ./libraries/omnitruck_client.rb:78
@@ -11,3 +10,4 @@ FC065: Ensure source_url is set in metadata: ./metadata.rb:1
11
10
  FC066: Ensure chef_version is set in metadata: ./metadata.rb:1
12
11
  FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
13
12
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
13
+ FC109: Use platform-specific package resources instead of provider property: ./recipes/default.rb:46
@@ -14,8 +14,29 @@ FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
14
14
  FC075: Cookbook uses node.save to save partial node data to the chef-server mid-run: ./recipes/master.rb:37
15
15
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
16
16
  FC082: Deprecated node.set or node.set_unless used to set node attributes: ./recipes/master.rb:36
17
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql.rb:44
18
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql.rb:56
19
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql.rb:69
20
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql_user.rb:39
21
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql_user.rb:50
22
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_mysql_user.rb:70
23
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql.rb:53
24
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql.rb:65
25
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql.rb:78
26
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql_user.rb:40
27
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql_user.rb:51
28
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_postgresql_user.rb:64
29
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server.rb:40
30
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server.rb:52
31
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server.rb:65
32
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server_user.rb:39
33
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server_user.rb:49
34
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server_user.rb:60
35
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server_user.rb:64
36
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/provider_database_sql_server_user.rb:81
17
37
  FC086: Use databag helper methods to load data bag items: ./recipes/ebs_backup.rb:22
18
38
  FC086: Use databag helper methods to load data bag items: ./recipes/ebs_backup.rb:38
19
39
  FC086: Use databag helper methods to load data bag items: ./recipes/ebs_volume.rb:27
20
40
  FC086: Use databag helper methods to load data bag items: ./recipes/ebs_volume.rb:70
21
41
  FC086: Use databag helper methods to load data bag items: ./recipes/ebs_volume.rb:78
42
+ FC104: Use the :run action in ruby_block instead of :create: ./recipes/ebs_volume.rb:104
@@ -29,3 +29,15 @@ FC074: LWRP should use DSL to define resource's default action: ./resources/conf
29
29
  FC074: LWRP should use DSL to define resource's default action: ./resources/pool.rb:1
30
30
  FC074: LWRP should use DSL to define resource's default action: ./resources/site.rb:1
31
31
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
32
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/app.rb:60
33
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:34
34
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:71
35
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:81
36
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:91
37
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:102
38
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pool.rb:108
39
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/site.rb:43
40
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/site.rb:87
41
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/site.rb:97
42
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/site.rb:107
43
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/site.rb:118
@@ -11,4 +11,8 @@ FC074: LWRP should use DSL to define resource's default action: ./resources/logi
11
11
  FC074: LWRP should use DSL to define resource's default action: ./resources/physical_volume.rb:1
12
12
  FC074: LWRP should use DSL to define resource's default action: ./resources/volume_group.rb:1
13
13
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
14
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/logical_volume.rb:46
15
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/volume_group.rb:22
16
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/volume_group.rb:50
14
17
  FC098: Deprecated Chef::Mixin::RecipeDefinitionDSLCore mixin used: ./resources/volume_group.rb:1
18
+ FC104: Use the :run action in ruby_block instead of :create: ./providers/volume_group.rb:38
@@ -7,3 +7,4 @@ FC066: Ensure chef_version is set in metadata: ./metadata.rb:1
7
7
  FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
8
8
  FC074: LWRP should use DSL to define resource's default action: ./resources/default.rb:1
9
9
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
10
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/default.rb:72
@@ -6,3 +6,4 @@ FC066: Ensure chef_version is set in metadata: ./metadata.rb:1
6
6
  FC069: Ensure standardized license defined in metadata: ./metadata.rb:1
7
7
  FC074: LWRP should use DSL to define resource's default action: ./resources/product.rb:1
8
8
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
9
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/product.rb:33
@@ -53,3 +53,17 @@ FC074: LWRP should use DSL to define resource's default action: ./resources/shor
53
53
  FC074: LWRP should use DSL to define resource's default action: ./resources/task.rb:1
54
54
  FC074: LWRP should use DSL to define resource's default action: ./resources/zipfile.rb:1
55
55
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
56
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/feature_base.rb:9
57
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./libraries/feature_base.rb:19
58
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/batch.rb:42
59
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/package.rb:48
60
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/package.rb:59
61
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/package.rb:68
62
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pagefile.rb:63
63
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/pagefile.rb:75
64
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/registry.rb:70
65
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/task.rb:38
66
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/task.rb:50
67
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/task.rb:68
68
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/task.rb:79
69
+ FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/zipfile.rb:41
@@ -17,3 +17,4 @@ FC074: LWRP should use DSL to define resource's default action: ./resources/repo
17
17
  FC078: Ensure cookbook shared under an OSI-approved open source license: ./metadata.rb:1
18
18
  FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/key.rb:76
19
19
  FC085: Resource using new_resource.updated_by_last_action to converge resource: ./providers/repository.rb:41
20
+ FC104: Use the :run action in ruby_block instead of :create: ./providers/repository.rb:94
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: 12.2.1
4
+ version: 12.2.2
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-11-14 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-core
@@ -183,7 +183,6 @@ files:
183
183
  - chef_dsl_metadata/chef_13.5.3.json
184
184
  - chef_dsl_metadata/chef_13.6.0.json
185
185
  - features/002_check_string_interpolation.feature
186
- - features/004_check_service_resource_used.feature
187
186
  - features/005_check_for_resource_repetition.feature
188
187
  - features/006_check_file_mode.feature
189
188
  - features/009_check_for_unrecognised_resource_attributes.feature
@@ -351,6 +350,7 @@ files:
351
350
  - man/foodcritic.1.ronn
352
351
  - misc/lucene.treetop
353
352
  - spec/functional/fc001_spec.rb
353
+ - spec/functional/fc004_spec.rb
354
354
  - spec/functional/fc007_spec.rb
355
355
  - spec/functional/fc008_spec.rb
356
356
  - spec/functional/fc009_spec.rb
@@ -541,5 +541,5 @@ rubyforge_project:
541
541
  rubygems_version: 2.6.13
542
542
  signing_key:
543
543
  specification_version: 4
544
- summary: foodcritic-12.2.1
544
+ summary: foodcritic-12.2.2
545
545
  test_files: []
@@ -1,53 +0,0 @@
1
- Feature: Check for service commands within execute resources
2
-
3
- In order to control services in an idiomatic way
4
- As a developer
5
- I want to identify if service commands are called by execute resources rather than using the service resource
6
-
7
- Scenario: Execute resource starting a service via init.d
8
- Given a cookbook recipe that uses execute to start a service via init.d
9
- When I check the cookbook
10
- Then the service resource warning 004 should be displayed
11
-
12
- Scenario Outline: Execute resource controlling a service via the service command
13
- Given a cookbook recipe that uses execute to <action> a service via the service command
14
- When I check the cookbook
15
- Then the service resource warning 004 <warning>
16
-
17
- Examples:
18
- | action | warning |
19
- | start | should be displayed |
20
- | stop | should be displayed |
21
- | restart | should be displayed |
22
- | reload | should be displayed |
23
- | initdb | should not be displayed |
24
-
25
- Scenario: Execute resource starting a service via upstart
26
- Given a cookbook recipe that uses execute to start a service via upstart
27
- When I check the cookbook
28
- Then the service resource warning 004 should be displayed
29
-
30
- Scenario: Execute resource starting a service via invoke-rc.d
31
- Given a cookbook recipe that uses execute to start a service via invoke-rc.d
32
- When I check the cookbook
33
- Then the service resource warning 004 should be displayed
34
-
35
- Scenario: Execute resource starting a service via the full path to the service command
36
- Given a cookbook recipe that uses execute to start a service via the full path to the service command
37
- When I check the cookbook
38
- Then the service resource warning 004 should be displayed
39
-
40
- Scenario: Execute resource starting a service via init.d (multiple commands)
41
- Given a cookbook recipe that uses execute to sleep and then start a service via init.d
42
- When I check the cookbook
43
- Then the service resource warning 004 should be displayed
44
-
45
- Scenario: Execute resource not controlling a service
46
- Given a cookbook recipe that uses execute to list a directory
47
- When I check the cookbook
48
- Then the service resource warning 004 should not be displayed
49
-
50
- Scenario: Execute resource using name attribute
51
- Given a cookbook recipe that uses execute with a name attribute to start a service
52
- When I check the cookbook
53
- Then the service resource warning 004 should be displayed