chef-dk 4.1.7 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/Gemfile.lock +113 -17
  4. data/lib/chef-dk/builtin_commands.rb +3 -0
  5. data/lib/chef-dk/cli.rb +3 -1
  6. data/lib/chef-dk/command/clean_policy_cookbooks.rb +1 -0
  7. data/lib/chef-dk/command/clean_policy_revisions.rb +1 -0
  8. data/lib/chef-dk/command/delete_policy.rb +1 -0
  9. data/lib/chef-dk/command/delete_policy_group.rb +1 -0
  10. data/lib/chef-dk/command/describe_cookbook.rb +1 -0
  11. data/lib/chef-dk/command/diff.rb +5 -3
  12. data/lib/chef-dk/command/env.rb +6 -6
  13. data/lib/chef-dk/command/export.rb +1 -0
  14. data/lib/chef-dk/command/generate.rb +1 -0
  15. data/lib/chef-dk/command/generator_commands/chef_exts/quieter_doc_formatter.rb +2 -4
  16. data/lib/chef-dk/command/generator_commands/generator_generator.rb +1 -0
  17. data/lib/chef-dk/command/install.rb +1 -0
  18. data/lib/chef-dk/command/push.rb +1 -0
  19. data/lib/chef-dk/command/push_archive.rb +1 -1
  20. data/lib/chef-dk/command/shell_init.rb +3 -2
  21. data/lib/chef-dk/command/show_policy.rb +1 -0
  22. data/lib/chef-dk/command/undelete.rb +1 -0
  23. data/lib/chef-dk/command/update.rb +1 -0
  24. data/lib/chef-dk/command/verify.rb +1 -1
  25. data/lib/chef-dk/component_test.rb +2 -1
  26. data/lib/chef-dk/configurable.rb +3 -2
  27. data/lib/chef-dk/cookbook_profiler/null_scm.rb +1 -2
  28. data/lib/chef-dk/generator.rb +1 -1
  29. data/lib/chef-dk/helpers.rb +2 -1
  30. data/lib/chef-dk/policyfile/artifactory_cookbook_source.rb +1 -1
  31. data/lib/chef-dk/policyfile/attribute_merge_checker.rb +1 -1
  32. data/lib/chef-dk/policyfile/chef_repo_cookbook_source.rb +1 -1
  33. data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +3 -3
  34. data/lib/chef-dk/policyfile/chef_server_lock_fetcher.rb +5 -5
  35. data/lib/chef-dk/policyfile/community_cookbook_source.rb +1 -1
  36. data/lib/chef-dk/policyfile/comparison_base.rb +1 -0
  37. data/lib/chef-dk/policyfile/cookbook_location_specification.rb +4 -4
  38. data/lib/chef-dk/policyfile/cookbook_locks.rb +8 -5
  39. data/lib/chef-dk/policyfile/delivery_supermarket_source.rb +1 -1
  40. data/lib/chef-dk/policyfile/differ.rb +6 -2
  41. data/lib/chef-dk/policyfile/dsl.rb +4 -2
  42. data/lib/chef-dk/policyfile/git_lock_fetcher.rb +2 -2
  43. data/lib/chef-dk/policyfile/included_policies_cookbook_source.rb +1 -1
  44. data/lib/chef-dk/policyfile/lister.rb +2 -2
  45. data/lib/chef-dk/policyfile/local_lock_fetcher.rb +7 -5
  46. data/lib/chef-dk/policyfile/lock_applier.rb +1 -1
  47. data/lib/chef-dk/policyfile/null_cookbook_source.rb +1 -2
  48. data/lib/chef-dk/policyfile/policyfile_location_specification.rb +3 -3
  49. data/lib/chef-dk/policyfile/remote_lock_fetcher.rb +1 -1
  50. data/lib/chef-dk/policyfile/solution_dependencies.rb +13 -11
  51. data/lib/chef-dk/policyfile/storage_config.rb +1 -0
  52. data/lib/chef-dk/policyfile/undo_record.rb +10 -8
  53. data/lib/chef-dk/policyfile/uploader.rb +3 -1
  54. data/lib/chef-dk/policyfile_compiler.rb +17 -13
  55. data/lib/chef-dk/policyfile_lock.rb +17 -15
  56. data/lib/chef-dk/policyfile_services/clean_policies.rb +3 -3
  57. data/lib/chef-dk/policyfile_services/clean_policy_cookbooks.rb +2 -2
  58. data/lib/chef-dk/policyfile_services/export_repo.rb +4 -2
  59. data/lib/chef-dk/policyfile_services/install.rb +3 -1
  60. data/lib/chef-dk/policyfile_services/push.rb +6 -5
  61. data/lib/chef-dk/policyfile_services/push_archive.rb +6 -5
  62. data/lib/chef-dk/policyfile_services/rm_policy.rb +6 -2
  63. data/lib/chef-dk/policyfile_services/rm_policy_group.rb +2 -2
  64. data/lib/chef-dk/policyfile_services/show_policy.rb +2 -2
  65. data/lib/chef-dk/policyfile_services/undelete.rb +2 -2
  66. data/lib/chef-dk/version.rb +1 -1
  67. data/lib/kitchen/provisioner/policyfile_zero.rb +3 -6
  68. data/spec/unit/cli_spec.rb +6 -6
  69. data/spec/unit/command/base_spec.rb +1 -1
  70. data/spec/unit/command/env_spec.rb +1 -1
  71. data/spec/unit/command/exec_spec.rb +1 -1
  72. data/spec/unit/command/export_spec.rb +1 -1
  73. data/spec/unit/command/generator_commands/recipe_spec.rb +2 -1
  74. data/spec/unit/command/generator_commands/repo_spec.rb +6 -6
  75. data/spec/unit/command/verify_spec.rb +1 -1
  76. data/spec/unit/policyfile/attribute_merge_checker_spec.rb +10 -8
  77. data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +4 -2
  78. data/spec/unit/policyfile/cookbook_locks_spec.rb +9 -9
  79. data/spec/unit/policyfile/git_lock_fetcher_spec.rb +5 -5
  80. data/spec/unit/policyfile/included_policies_cookbook_source_spec.rb +5 -3
  81. data/spec/unit/policyfile/lister_spec.rb +5 -5
  82. data/spec/unit/policyfile/local_lock_fetcher_spec.rb +1 -1
  83. data/spec/unit/policyfile/lock_applier_spec.rb +2 -2
  84. data/spec/unit/policyfile/reports/install_spec.rb +14 -14
  85. data/spec/unit/policyfile/reports/upload_spec.rb +3 -3
  86. data/spec/unit/policyfile/uploader_spec.rb +13 -12
  87. data/spec/unit/policyfile_demands_spec.rb +4 -4
  88. data/spec/unit/policyfile_includes_spec.rb +14 -7
  89. data/spec/unit/policyfile_install_with_includes_spec.rb +8 -7
  90. data/spec/unit/policyfile_lock_build_spec.rb +17 -18
  91. data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +5 -5
  92. data/spec/unit/policyfile_services/push_archive_spec.rb +6 -6
  93. data/spec/unit/policyfile_services/push_spec.rb +8 -8
  94. data/spec/unit/policyfile_services/rm_policy_group_spec.rb +5 -5
  95. data/spec/unit/policyfile_services/rm_policy_spec.rb +5 -5
  96. data/spec/unit/policyfile_services/update_attributes_spec.rb +2 -1
  97. data/spec/unit/service_exception_inspectors/http_spec.rb +7 -7
  98. metadata +2 -2
@@ -45,7 +45,7 @@ module ChefDK
45
45
  [ remove_policy(policy), policy ]
46
46
  end
47
47
 
48
- failures = results.select { |result, _policy| result.kind_of?(Exception) }
48
+ failures = results.select { |result, _policy| result.is_a?(Exception) }
49
49
 
50
50
  unless failures.empty?
51
51
  details = failures.map do |result, policy|
@@ -76,8 +76,8 @@ module ChefDK
76
76
 
77
77
  def http_client
78
78
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
79
- signing_key_filename: chef_config.client_key,
80
- client_name: chef_config.node_name)
79
+ signing_key_filename: chef_config.client_key,
80
+ client_name: chef_config.node_name)
81
81
  end
82
82
 
83
83
  private
@@ -115,8 +115,8 @@ module ChefDK
115
115
  # server URL and credentials.
116
116
  def http_client
117
117
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
118
- signing_key_filename: chef_config.client_key,
119
- client_name: chef_config.node_name)
118
+ signing_key_filename: chef_config.client_key,
119
+ client_name: chef_config.node_name)
120
120
  end
121
121
  end
122
122
  end
@@ -90,6 +90,7 @@ module ChefDK
90
90
 
91
91
  def archive_file_location
92
92
  return nil unless archive?
93
+
93
94
  filename = "#{policyfile_lock.name}-#{policyfile_lock.revision_id}.tgz"
94
95
  File.join(export_dir, filename)
95
96
  end
@@ -158,7 +159,7 @@ module ChefDK
158
159
  dirname = "#{lock.name}-#{lock.identifier}"
159
160
  export_path = File.join(staging_dir, "cookbook_artifacts", dirname)
160
161
  metadata_rb_path = File.join(export_path, "metadata.rb")
161
- FileUtils.mkdir(export_path) if not File.directory?(export_path)
162
+ FileUtils.mkdir(export_path) unless File.directory?(export_path)
162
163
  copy_unignored_cookbook_files(lock, export_path)
163
164
  FileUtils.rm_f(metadata_rb_path)
164
165
  metadata = lock.cookbook_version.metadata
@@ -320,6 +321,7 @@ module ChefDK
320
321
 
321
322
  def validate_lockfile
322
323
  return @policyfile_lock if @policyfile_lock
324
+
323
325
  @policyfile_lock = ChefDK::PolicyfileLock.new(storage_config).build_from_lock_data(policy_data)
324
326
  # TODO: enumerate any cookbook that have been updated
325
327
  @policyfile_lock.validate_cookbooks!
@@ -344,7 +346,7 @@ module ChefDK
344
346
 
345
347
  def assert_export_dir_clean!
346
348
  if !force_export? && !conflicting_fs_entries.empty? && !archive?
347
- msg = "Export dir (#{export_dir}) not clean. Refusing to export. (Conflicting files: #{conflicting_fs_entries.join(', ')})"
349
+ msg = "Export dir (#{export_dir}) not clean. Refusing to export. (Conflicting files: #{conflicting_fs_entries.join(", ")})"
348
350
  raise ExportDirNotEmpty, msg
349
351
  end
350
352
  end
@@ -84,6 +84,7 @@ module ChefDK
84
84
 
85
85
  def policyfile_lock
86
86
  return nil if policyfile_lock_content.nil?
87
+
87
88
  @policyfile_lock ||= begin
88
89
  lock_data = FFI_Yajl::Parser.new.parse(policyfile_lock_content)
89
90
  PolicyfileLock.new(storage_config, ui: ui).build_from_lock_data(lock_data)
@@ -115,7 +116,7 @@ module ChefDK
115
116
  end
116
117
 
117
118
  def update_lock_and_install(cookbooks_to_update, exclude_deps)
118
- ui.msg "Updating #{cookbooks_to_update.join(',')} cookbooks #{exclude_deps ? '(excluding dependencies)' : ''}"
119
+ ui.msg "Updating #{cookbooks_to_update.join(",")} cookbooks #{exclude_deps ? "(excluding dependencies)" : ""}"
119
120
  to_update = if exclude_deps
120
121
  cookbooks_to_update
121
122
  else
@@ -134,6 +135,7 @@ module ChefDK
134
135
 
135
136
  policyfile_lock.cookbook_locks.each do |ck_name, location_spec|
136
137
  next if to_update.include?(ck_name)
138
+
137
139
  # we need to feed policyfile_compiler.cookbook_location_spec_for with a CookbookLocationSpecification
138
140
  policyfile_compiler.dsl.cookbook_location_specs[ck_name] = Policyfile::CookbookLocationSpecification.new(
139
141
  ck_name,
@@ -52,8 +52,8 @@ module ChefDK
52
52
 
53
53
  def http_client
54
54
  @http_client ||= Chef::ServerAPI.new(config.chef_server_url,
55
- signing_key_filename: config.client_key,
56
- client_name: config.node_name)
55
+ signing_key_filename: config.client_key,
56
+ client_name: config.node_name)
57
57
  end
58
58
 
59
59
  def policy_data
@@ -64,9 +64,9 @@ module ChefDK
64
64
 
65
65
  def uploader
66
66
  ChefDK::Policyfile::Uploader.new(policyfile_lock, policy_group,
67
- ui: ui,
68
- http_client: http_client,
69
- policy_document_native_api: config.policy_document_native_api)
67
+ ui: ui,
68
+ http_client: http_client,
69
+ policy_document_native_api: config.policy_document_native_api)
70
70
  end
71
71
 
72
72
  def run
@@ -99,6 +99,7 @@ module ChefDK
99
99
 
100
100
  def validate_lockfile
101
101
  return @policyfile_lock if @policyfile_lock
102
+
102
103
  @policyfile_lock = ChefDK::PolicyfileLock.new(storage_config).build_from_lock_data(policy_data)
103
104
  # TODO: enumerate any cookbook that have been updated
104
105
  @policyfile_lock.validate_cookbooks!
@@ -56,6 +56,7 @@ module ChefDK
56
56
  unless File.exist?(archive_file_path)
57
57
  raise InvalidPolicyArchive, "Archive file #{archive_file_path} not found"
58
58
  end
59
+
59
60
  stage_unpacked_archive do |staging_dir|
60
61
  read_policyfile_lock(staging_dir)
61
62
 
@@ -69,16 +70,16 @@ module ChefDK
69
70
  # @api private
70
71
  def uploader
71
72
  ChefDK::Policyfile::Uploader.new(policyfile_lock, policy_group,
72
- ui: ui,
73
- http_client: http_client,
74
- policy_document_native_api: config.policy_document_native_api)
73
+ ui: ui,
74
+ http_client: http_client,
75
+ policy_document_native_api: config.policy_document_native_api)
75
76
  end
76
77
 
77
78
  # @api private
78
79
  def http_client
79
80
  @http_client ||= Chef::ServerAPI.new(config.chef_server_url,
80
- signing_key_filename: config.client_key,
81
- client_name: config.node_name)
81
+ signing_key_filename: config.client_key,
82
+ client_name: config.node_name)
82
83
  end
83
84
 
84
85
  private
@@ -76,8 +76,8 @@ module ChefDK
76
76
  # server URL and credentials.
77
77
  def http_client
78
78
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
79
- signing_key_filename: chef_config.client_key,
80
- client_name: chef_config.node_name)
79
+ signing_key_filename: chef_config.client_key,
80
+ client_name: chef_config.node_name)
81
81
  end
82
82
 
83
83
  private
@@ -108,6 +108,7 @@ module ChefDK
108
108
  next unless group_info.key?("policies") && !group_info["policies"].empty?
109
109
  next unless group_info["policies"].key?(policy_name)
110
110
  next unless group_info["policies"][policy_name]["revision_id"] == revision_id
111
+
111
112
  groups << group_name if group_info
112
113
  end
113
114
  groups
@@ -119,12 +120,14 @@ module ChefDK
119
120
 
120
121
  def policy_exists?
121
122
  return true if @policy_exists
123
+
122
124
  fetch_policy_revision_data
123
125
  @policy_exists
124
126
  end
125
127
 
126
128
  def policy_revision_data
127
129
  return @policy_revision_data if @policy_exists
130
+
128
131
  fetch_policy_revision_data
129
132
  end
130
133
 
@@ -133,6 +136,7 @@ module ChefDK
133
136
  @policy_exists = true
134
137
  rescue Net::HTTPServerException => e
135
138
  raise unless e.response.code == "404"
139
+
136
140
  @policy_exists = false
137
141
  end
138
142
 
@@ -77,8 +77,8 @@ module ChefDK
77
77
  # server URL and credentials.
78
78
  def http_client
79
79
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
80
- signing_key_filename: chef_config.client_key,
81
- client_name: chef_config.node_name)
80
+ signing_key_filename: chef_config.client_key,
81
+ client_name: chef_config.node_name)
82
82
  end
83
83
  end
84
84
  end
@@ -217,8 +217,8 @@ module ChefDK
217
217
 
218
218
  def http_client
219
219
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
220
- signing_key_filename: chef_config.client_key,
221
- client_name: chef_config.node_name)
220
+ signing_key_filename: chef_config.client_key,
221
+ client_name: chef_config.node_name)
222
222
  end
223
223
 
224
224
  private
@@ -72,8 +72,8 @@ module ChefDK
72
72
 
73
73
  def http_client
74
74
  @http_client ||= Chef::ServerAPI.new(chef_config.chef_server_url,
75
- signing_key_filename: chef_config.client_key,
76
- client_name: chef_config.node_name)
75
+ signing_key_filename: chef_config.client_key,
76
+ client_name: chef_config.node_name)
77
77
  end
78
78
 
79
79
  private
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefDK
19
- VERSION = "4.1.7".freeze
19
+ VERSION = "4.2.0".freeze
20
20
  end
@@ -45,8 +45,7 @@ module Kitchen
45
45
  # issues since berks is not yet using Solve 2.x. See also
46
46
  # PolicyfileZero#load_needed_dependencies! which is stubbed to prevent
47
47
  # berks from loading.
48
- def prepare_cookbooks
49
- end
48
+ def prepare_cookbooks; end
50
49
 
51
50
  end
52
51
 
@@ -125,8 +124,7 @@ module Kitchen
125
124
 
126
125
  # We don't want to load Berkshelf or Librarian; Policyfile is managing
127
126
  # dependencies, so these can only cause trouble.
128
- def load_needed_dependencies!
129
- end
127
+ def load_needed_dependencies!; end
130
128
 
131
129
  private
132
130
 
@@ -134,8 +132,7 @@ module Kitchen
134
132
  # don't need it.
135
133
  #
136
134
  # @api private
137
- def prepare_json
138
- end
135
+ def prepare_json; end
139
136
 
140
137
  # Copies the policyfile's cookbooks to the sandbox.
141
138
  #
@@ -354,12 +354,12 @@ describe ChefDK::CLI do
354
354
  before do
355
355
  allow(File).to receive(:exist?).with(chefdk_embedded_path).and_return(false)
356
356
 
357
- [
358
- :omnibus_root,
359
- :omnibus_apps_dir,
360
- :omnibus_bin_dir,
361
- :omnibus_embedded_bin_dir,
362
- ].each do |method_name|
357
+ %i{
358
+ omnibus_root
359
+ omnibus_apps_dir
360
+ omnibus_bin_dir
361
+ omnibus_embedded_bin_dir
362
+ }.each do |method_name|
363
363
  allow(cli).to receive(method_name).and_raise(ChefDK::OmnibusInstallNotFound.new)
364
364
  end
365
365
  end
@@ -41,7 +41,7 @@ describe ChefDK::Command::Base do
41
41
 
42
42
  let(:stderr_io) { StringIO.new }
43
43
  let(:stdout_io) { StringIO.new }
44
- let(:command_instance) { TestCommand.new() }
44
+ let(:command_instance) { TestCommand.new }
45
45
  let(:enforce_license) { false }
46
46
 
47
47
  def stdout
@@ -21,7 +21,7 @@ require "chef-dk/command/env"
21
21
 
22
22
  describe ChefDK::Command::Env do
23
23
  let(:ui) { TestHelpers::TestUI.new }
24
- let(:command_instance) { ChefDK::Command::Env.new() }
24
+ let(:command_instance) { ChefDK::Command::Env.new }
25
25
 
26
26
  let(:command_options) { [] }
27
27
 
@@ -19,7 +19,7 @@ require "spec_helper"
19
19
  require "chef-dk/command/exec"
20
20
 
21
21
  describe ChefDK::Command::Exec do
22
- let(:command_instance) { ChefDK::Command::Exec.new() }
22
+ let(:command_instance) { ChefDK::Command::Exec.new }
23
23
 
24
24
  let(:command_options) { [] }
25
25
 
@@ -35,7 +35,7 @@ describe ChefDK::Command::Export do
35
35
 
36
36
  let(:export_service) do
37
37
  instance_double(ChefDK::PolicyfileServices::ExportRepo,
38
- policyfile_lock: policyfile_lock)
38
+ policyfile_lock: policyfile_lock)
39
39
  end
40
40
 
41
41
  context "after evaluating params" do
@@ -29,7 +29,8 @@ describe ChefDK::Command::GeneratorCommands::Recipe do
29
29
  "spec/spec_helper.rb",
30
30
  "spec/unit/recipes/new_recipe_spec.rb",
31
31
  "test/integration/default/new_recipe_test.rb",
32
- ] end
32
+ ]
33
+ end
33
34
  let(:new_file_name) { "new_recipe" }
34
35
 
35
36
  end
@@ -186,7 +186,7 @@ describe ChefDK::Command::GeneratorCommands::Repo do
186
186
  let(:file) { "chefignore" }
187
187
 
188
188
  it "has the preamble" do
189
- expect(file_contents).to match(/Put files\/directories that should be ignored in this file when uploading/)
189
+ expect(file_contents).to match(%r{Put files/directories that should be ignored in this file when uploading})
190
190
  end
191
191
  end
192
192
 
@@ -195,17 +195,17 @@ describe ChefDK::Command::GeneratorCommands::Repo do
195
195
 
196
196
  it "has the right contents" do
197
197
  expect(file_contents).to match(/\.rake_test_cache/)
198
- expect(file_contents).to match(/\.chef\/\*\.pem/)
199
- expect(file_contents).to match(/\.chef\/encrypted_data_bag_secret/)
200
- expect(file_contents).to_not match(/cookbooks\/\*\*/)
198
+ expect(file_contents).to match(%r{\.chef/\*\.pem})
199
+ expect(file_contents).to match(%r{\.chef/encrypted_data_bag_secret})
200
+ expect(file_contents).to_not match(%r{cookbooks/\*\*})
201
201
  end
202
202
 
203
203
  context "with --policy-only" do
204
204
  let(:argv) { ["new_repo", "--policy-only" ] }
205
205
 
206
206
  it "blocks cookbooks" do
207
- expect(file_contents).to match(/cookbooks\/\*\*/)
208
- expect(file_contents).to match(/cookbooks\/README\.md/)
207
+ expect(file_contents).to match(%r{cookbooks/\*\*})
208
+ expect(file_contents).to match(%r{cookbooks/README\.md})
209
209
  end
210
210
  end
211
211
  end
@@ -29,7 +29,7 @@ end
29
29
 
30
30
  describe ChefDK::Command::Verify do
31
31
 
32
- let(:command_instance) { ChefDK::Command::Verify.new() }
32
+ let(:command_instance) { ChefDK::Command::Verify.new }
33
33
 
34
34
  let(:command_options) { [] }
35
35
 
@@ -54,10 +54,11 @@ describe ChefDK::Policyfile::AttributeMergeChecker do
54
54
 
55
55
  it "raises an error" do
56
56
  expect { checker.check! }.to raise_error(
57
- ChefDK::Policyfile::AttributeMergeChecker::ConflictError) do |e|
58
- expect(e.attribute_path).to eq("[a]")
59
- expect(e.provided_by).to include("foo", "bar")
60
- end
57
+ ChefDK::Policyfile::AttributeMergeChecker::ConflictError
58
+ ) do |e|
59
+ expect(e.attribute_path).to eq("[a]")
60
+ expect(e.provided_by).to include("foo", "bar")
61
+ end
61
62
  end
62
63
  end
63
64
 
@@ -69,10 +70,11 @@ describe ChefDK::Policyfile::AttributeMergeChecker do
69
70
 
70
71
  it "raises an error" do
71
72
  expect { checker.check! }.to raise_error(
72
- ChefDK::Policyfile::AttributeMergeChecker::ConflictError) do |e|
73
- expect(e.attribute_path).to eq("[a][b]")
74
- expect(e.provided_by).to include("foo", "bar")
75
- end
73
+ ChefDK::Policyfile::AttributeMergeChecker::ConflictError
74
+ ) do |e|
75
+ expect(e.attribute_path).to eq("[a][b]")
76
+ expect(e.provided_by).to include("foo", "bar")
77
+ end
76
78
  end
77
79
  end
78
80
  end
@@ -146,7 +146,8 @@ describe ChefDK::Policyfile::ChefServerLockFetcher do
146
146
 
147
147
  it "includes the revision id in the source_options_for_lock" do
148
148
  allow(http_client).to receive(:get).with(
149
- "policy_groups/#{policy_group}/policies/#{policy_name}").and_return(minimal_lockfile)
149
+ "policy_groups/#{policy_group}/policies/#{policy_name}"
150
+ ).and_return(minimal_lockfile)
150
151
 
151
152
  expect(fetcher.source_options_for_lock).to eq(source_options_for_lock)
152
153
  end
@@ -154,7 +155,8 @@ describe ChefDK::Policyfile::ChefServerLockFetcher do
154
155
  it "correctly applies source_options that were included in the lock" do
155
156
  fetcher.apply_locked_source_options(source_options_for_lock)
156
157
  expect(http_client).to receive(:get).with(
157
- "policies/#{policy_name}/revisions/#{revision_id}").and_return(minimal_lockfile)
158
+ "policies/#{policy_name}/revisions/#{revision_id}"
159
+ ).and_return(minimal_lockfile)
158
160
  fetcher.lock_data
159
161
  end
160
162
  end
@@ -221,9 +221,9 @@ describe ChefDK::Policyfile::LocalCookbook do
221
221
  describe "gathering identifier info" do
222
222
  let(:identifiers) do
223
223
  instance_double("ChefDK::CookbookProfiler::Identifiers",
224
- content_identifier: "abc123",
225
- dotted_decimal_identifier: "111.222.333",
226
- semver_version: "1.2.3")
224
+ content_identifier: "abc123",
225
+ dotted_decimal_identifier: "111.222.333",
226
+ semver_version: "1.2.3")
227
227
  end
228
228
 
229
229
  before do
@@ -364,9 +364,9 @@ describe ChefDK::Policyfile::LocalCookbook do
364
364
 
365
365
  let(:identifiers) do
366
366
  instance_double("ChefDK::CookbookProfiler::Identifiers",
367
- content_identifier: "abc123",
368
- dotted_decimal_identifier: "111.222.333",
369
- semver_version: "1.2.3")
367
+ content_identifier: "abc123",
368
+ dotted_decimal_identifier: "111.222.333",
369
+ semver_version: "1.2.3")
370
370
  end
371
371
 
372
372
  it "has the correct identifier" do
@@ -399,9 +399,9 @@ describe ChefDK::Policyfile::LocalCookbook do
399
399
  # represents the updated state of the cookbook
400
400
  let(:identifiers) do
401
401
  instance_double("ChefDK::CookbookProfiler::Identifiers",
402
- content_identifier: "def456",
403
- dotted_decimal_identifier: "777.888.999",
404
- semver_version: "7.8.9")
402
+ content_identifier: "def456",
403
+ dotted_decimal_identifier: "777.888.999",
404
+ semver_version: "7.8.9")
405
405
  end
406
406
 
407
407
  it "sets the content identifier to the new identifier" do