chef-dk 1.2.22 → 1.3.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +8 -12
  3. data/Gemfile.lock +120 -116
  4. data/README.md +4 -3
  5. data/Rakefile +54 -0
  6. data/acceptance/Gemfile.lock +36 -47
  7. data/bin/chef +1 -1
  8. data/chef-dk.gemspec +9 -9
  9. data/lib/chef-dk/authenticated_http.rb +6 -7
  10. data/lib/chef-dk/builtin_commands.rb +3 -4
  11. data/lib/chef-dk/chef_runner.rb +7 -8
  12. data/lib/chef-dk/cli.rb +11 -11
  13. data/lib/chef-dk/command/base.rb +4 -4
  14. data/lib/chef-dk/command/clean_policy_cookbooks.rb +4 -5
  15. data/lib/chef-dk/command/clean_policy_revisions.rb +4 -6
  16. data/lib/chef-dk/command/delete_policy.rb +4 -6
  17. data/lib/chef-dk/command/delete_policy_group.rb +6 -8
  18. data/lib/chef-dk/command/diff.rb +9 -10
  19. data/lib/chef-dk/command/env.rb +26 -27
  20. data/lib/chef-dk/command/exec.rb +5 -6
  21. data/lib/chef-dk/command/export.rb +8 -10
  22. data/lib/chef-dk/command/gem.rb +5 -5
  23. data/lib/chef-dk/command/generate.rb +19 -19
  24. data/lib/chef-dk/command/generator_commands.rb +8 -8
  25. data/lib/chef-dk/command/generator_commands/app.rb +2 -3
  26. data/lib/chef-dk/command/generator_commands/attribute.rb +2 -3
  27. data/lib/chef-dk/command/generator_commands/base.rb +13 -13
  28. data/lib/chef-dk/command/generator_commands/build_cookbook.rb +2 -2
  29. data/lib/chef-dk/command/generator_commands/chef_exts/generator_desc_resource.rb +2 -2
  30. data/lib/chef-dk/command/generator_commands/chef_exts/quieter_doc_formatter.rb +1 -2
  31. data/lib/chef-dk/command/generator_commands/chef_exts/recipe_dsl_ext.rb +1 -2
  32. data/lib/chef-dk/command/generator_commands/cookbook.rb +2 -2
  33. data/lib/chef-dk/command/generator_commands/cookbook_code_file.rb +3 -3
  34. data/lib/chef-dk/command/generator_commands/cookbook_file.rb +2 -2
  35. data/lib/chef-dk/command/generator_commands/generator_generator.rb +4 -7
  36. data/lib/chef-dk/command/generator_commands/lwrp.rb +2 -2
  37. data/lib/chef-dk/command/generator_commands/policyfile.rb +2 -3
  38. data/lib/chef-dk/command/generator_commands/recipe.rb +2 -2
  39. data/lib/chef-dk/command/generator_commands/repo.rb +1 -3
  40. data/lib/chef-dk/command/generator_commands/template.rb +2 -2
  41. data/lib/chef-dk/command/install.rb +4 -5
  42. data/lib/chef-dk/command/provision.rb +12 -14
  43. data/lib/chef-dk/command/push.rb +5 -6
  44. data/lib/chef-dk/command/push_archive.rb +4 -5
  45. data/lib/chef-dk/command/shell_init.rb +15 -16
  46. data/lib/chef-dk/command/show_policy.rb +5 -7
  47. data/lib/chef-dk/command/undelete.rb +6 -7
  48. data/lib/chef-dk/command/update.rb +5 -6
  49. data/lib/chef-dk/command/verify.rb +30 -31
  50. data/lib/chef-dk/commands_map.rb +1 -3
  51. data/lib/chef-dk/component_test.rb +13 -13
  52. data/lib/chef-dk/configurable.rb +2 -2
  53. data/lib/chef-dk/cookbook_metadata.rb +2 -2
  54. data/lib/chef-dk/cookbook_omnifetch.rb +7 -8
  55. data/lib/chef-dk/cookbook_profiler/git.rb +8 -8
  56. data/lib/chef-dk/cookbook_profiler/identifiers.rb +7 -7
  57. data/lib/chef-dk/cookbook_profiler/null_scm.rb +0 -1
  58. data/lib/chef-dk/exceptions.rb +1 -1
  59. data/lib/chef-dk/generator.rb +9 -7
  60. data/lib/chef-dk/helpers.rb +15 -15
  61. data/lib/chef-dk/pager.rb +2 -3
  62. data/lib/chef-dk/policyfile/chef_repo_cookbook_source.rb +4 -4
  63. data/lib/chef-dk/policyfile/chef_server_cookbook_source.rb +6 -6
  64. data/lib/chef-dk/policyfile/community_cookbook_source.rb +4 -5
  65. data/lib/chef-dk/policyfile/comparison_base.rb +3 -4
  66. data/lib/chef-dk/policyfile/cookbook_location_specification.rb +6 -6
  67. data/lib/chef-dk/policyfile/cookbook_locks.rb +11 -11
  68. data/lib/chef-dk/policyfile/cookbook_sources.rb +5 -5
  69. data/lib/chef-dk/policyfile/delivery_supermarket_source.rb +8 -9
  70. data/lib/chef-dk/policyfile/differ.rb +7 -10
  71. data/lib/chef-dk/policyfile/dsl.rb +10 -11
  72. data/lib/chef-dk/policyfile/lister.rb +3 -6
  73. data/lib/chef-dk/policyfile/null_cookbook_source.rb +3 -3
  74. data/lib/chef-dk/policyfile/read_cookbook_for_compat_mode_upload.rb +3 -3
  75. data/lib/chef-dk/policyfile/reports/install.rb +3 -4
  76. data/lib/chef-dk/policyfile/reports/table_printer.rb +0 -1
  77. data/lib/chef-dk/policyfile/reports/upload.rb +4 -4
  78. data/lib/chef-dk/policyfile/solution_dependencies.rb +22 -22
  79. data/lib/chef-dk/policyfile/source_uri.rb +2 -2
  80. data/lib/chef-dk/policyfile/storage_config.rb +4 -5
  81. data/lib/chef-dk/policyfile/undo_record.rb +6 -9
  82. data/lib/chef-dk/policyfile/undo_stack.rb +5 -7
  83. data/lib/chef-dk/policyfile/uploader.rb +8 -8
  84. data/lib/chef-dk/policyfile_compiler.rb +16 -20
  85. data/lib/chef-dk/policyfile_lock.rb +10 -11
  86. data/lib/chef-dk/policyfile_services/clean_policies.rb +3 -3
  87. data/lib/chef-dk/policyfile_services/clean_policy_cookbooks.rb +3 -5
  88. data/lib/chef-dk/policyfile_services/export_repo.rb +13 -14
  89. data/lib/chef-dk/policyfile_services/install.rb +6 -6
  90. data/lib/chef-dk/policyfile_services/push.rb +6 -8
  91. data/lib/chef-dk/policyfile_services/push_archive.rb +6 -10
  92. data/lib/chef-dk/policyfile_services/rm_policy.rb +4 -5
  93. data/lib/chef-dk/policyfile_services/rm_policy_group.rb +4 -5
  94. data/lib/chef-dk/policyfile_services/show_policy.rb +5 -6
  95. data/lib/chef-dk/policyfile_services/undelete.rb +3 -3
  96. data/lib/chef-dk/policyfile_services/update_attributes.rb +4 -6
  97. data/lib/chef-dk/service_exception_inspectors.rb +2 -3
  98. data/lib/chef-dk/service_exception_inspectors/base.rb +0 -1
  99. data/lib/chef-dk/service_exception_inspectors/http.rb +1 -3
  100. data/lib/chef-dk/service_exceptions.rb +1 -2
  101. data/lib/chef-dk/shell_out.rb +1 -1
  102. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/.kitchen.yml +2 -2
  103. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/README.md +2 -2
  104. data/lib/chef-dk/skeletons/code_generator/files/default/build_cookbook/test-fixture-recipe.rb +1 -0
  105. data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +1 -1
  106. data/lib/chef-dk/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +1 -1
  107. data/lib/chef-dk/skeletons/code_generator/metadata.rb +0 -1
  108. data/lib/chef-dk/skeletons/code_generator/recipes/app.rb +6 -6
  109. data/lib/chef-dk/skeletons/code_generator/recipes/attribute.rb +3 -3
  110. data/lib/chef-dk/skeletons/code_generator/recipes/build_cookbook.rb +43 -39
  111. data/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb +31 -22
  112. data/lib/chef-dk/skeletons/code_generator/recipes/cookbook_file.rb +5 -5
  113. data/lib/chef-dk/skeletons/code_generator/recipes/lwrp.rb +4 -4
  114. data/lib/chef-dk/skeletons/code_generator/recipes/policyfile.rb +1 -1
  115. data/lib/chef-dk/skeletons/code_generator/recipes/recipe.rb +8 -8
  116. data/lib/chef-dk/skeletons/code_generator/recipes/repo.rb +15 -15
  117. data/lib/chef-dk/skeletons/code_generator/recipes/template.rb +6 -6
  118. data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/Berksfile.erb +0 -2
  119. data/lib/chef-dk/skeletons/code_generator/templates/default/build_cookbook/metadata.rb.erb +1 -0
  120. data/lib/chef-dk/skeletons/code_generator/templates/default/inspec_default_test.rb.erb +4 -4
  121. data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen.yml.erb +1 -1
  122. data/lib/chef-dk/skeletons/code_generator/templates/default/kitchen_policyfile.yml.erb +1 -1
  123. data/lib/chef-dk/skeletons/code_generator/templates/default/metadata.rb.erb +4 -3
  124. data/lib/chef-dk/skeletons/code_generator/templates/default/recipe_spec.rb.erb +4 -2
  125. data/lib/chef-dk/ui.rb +0 -1
  126. data/lib/chef-dk/version.rb +1 -1
  127. data/lib/kitchen/provisioner/policyfile_zero.rb +7 -7
  128. data/omnibus_overrides.rb +3 -3
  129. data/spec/shared/a_file_generator.rb +3 -3
  130. data/spec/shared/custom_generator_cookbook.rb +6 -6
  131. data/spec/shared/fixture_cookbook_checksums.rb +2 -3
  132. data/spec/shared/setup_git_committer_config.rb +1 -1
  133. data/spec/shared/setup_git_cookbooks.rb +2 -2
  134. data/spec/spec_helper.rb +5 -5
  135. data/spec/test_helpers.rb +2 -2
  136. data/spec/unit/chef_runner_spec.rb +5 -7
  137. data/spec/unit/cli_spec.rb +36 -37
  138. data/spec/unit/command/base_spec.rb +4 -5
  139. data/spec/unit/command/clean_policy_cookbooks_spec.rb +8 -9
  140. data/spec/unit/command/clean_policy_revisions_spec.rb +8 -9
  141. data/spec/unit/command/delete_policy_group_spec.rb +11 -12
  142. data/spec/unit/command/delete_policy_spec.rb +11 -12
  143. data/spec/unit/command/diff_spec.rb +5 -6
  144. data/spec/unit/command/env_spec.rb +5 -5
  145. data/spec/unit/command/exec_spec.rb +18 -19
  146. data/spec/unit/command/export_spec.rb +5 -6
  147. data/spec/unit/command/generate_spec.rb +10 -10
  148. data/spec/unit/command/generator_commands/app_spec.rb +6 -6
  149. data/spec/unit/command/generator_commands/attribute_spec.rb +3 -4
  150. data/spec/unit/command/generator_commands/base_spec.rb +46 -46
  151. data/spec/unit/command/generator_commands/build_cookbook_spec.rb +50 -16
  152. data/spec/unit/command/generator_commands/chef_exts/generator_desc_resource_spec.rb +9 -9
  153. data/spec/unit/command/generator_commands/chef_exts/recipe_dsl_ext_spec.rb +16 -16
  154. data/spec/unit/command/generator_commands/cookbook_file_spec.rb +3 -4
  155. data/spec/unit/command/generator_commands/cookbook_spec.rb +23 -26
  156. data/spec/unit/command/generator_commands/generator_generator_spec.rb +4 -6
  157. data/spec/unit/command/generator_commands/lwrp_spec.rb +3 -4
  158. data/spec/unit/command/generator_commands/policyfile_spec.rb +3 -5
  159. data/spec/unit/command/generator_commands/recipe_spec.rb +4 -4
  160. data/spec/unit/command/generator_commands/repo_spec.rb +11 -11
  161. data/spec/unit/command/generator_commands/template_spec.rb +3 -4
  162. data/spec/unit/command/install_spec.rb +6 -6
  163. data/spec/unit/command/provision_spec.rb +27 -30
  164. data/spec/unit/command/push_archive_spec.rb +3 -3
  165. data/spec/unit/command/push_spec.rb +5 -6
  166. data/spec/unit/command/shell_init_spec.rb +17 -19
  167. data/spec/unit/command/show_policy_spec.rb +11 -12
  168. data/spec/unit/command/undelete_spec.rb +12 -14
  169. data/spec/unit/command/update_spec.rb +8 -8
  170. data/spec/unit/command/verify_spec.rb +10 -10
  171. data/spec/unit/commands_map_spec.rb +4 -4
  172. data/spec/unit/component_test_spec.rb +3 -3
  173. data/spec/unit/configurable_spec.rb +7 -7
  174. data/spec/unit/cookbook_metadata_spec.rb +5 -7
  175. data/spec/unit/cookbook_profiler/git_spec.rb +6 -7
  176. data/spec/unit/cookbook_profiler/identifiers_spec.rb +5 -7
  177. data/spec/unit/fixtures/command/cli_test_command.rb +2 -2
  178. data/spec/unit/fixtures/configurable/test_configurable.rb +1 -1
  179. data/spec/unit/fixtures/cookbooks_api/update_fixtures.rb +13 -16
  180. data/spec/unit/fixtures/eg_omnibus_dir/valid/embedded/apps/berkshelf/verify_me +1 -1
  181. data/spec/unit/gemfile_util_spec.rb +4 -4
  182. data/spec/unit/generator_spec.rb +10 -10
  183. data/spec/unit/helpers_spec.rb +31 -31
  184. data/spec/unit/pager_spec.rb +5 -7
  185. data/spec/unit/policyfile/chef_repo_cookbook_source_spec.rb +11 -11
  186. data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +13 -13
  187. data/spec/unit/policyfile/community_cookbook_source_spec.rb +3 -4
  188. data/spec/unit/policyfile/comparison_base_spec.rb +3 -6
  189. data/spec/unit/policyfile/cookbook_location_specification_spec.rb +3 -3
  190. data/spec/unit/policyfile/cookbook_locks_spec.rb +7 -9
  191. data/spec/unit/policyfile/delivery_supermarket_source_spec.rb +16 -17
  192. data/spec/unit/policyfile/differ_spec.rb +4 -5
  193. data/spec/unit/policyfile/lister_spec.rb +31 -35
  194. data/spec/unit/policyfile/null_cookbook_source_spec.rb +2 -3
  195. data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +3 -3
  196. data/spec/unit/policyfile/reports/install_spec.rb +4 -5
  197. data/spec/unit/policyfile/reports/upload_spec.rb +4 -6
  198. data/spec/unit/policyfile/solution_dependencies_spec.rb +13 -13
  199. data/spec/unit/policyfile/source_uri_spec.rb +5 -5
  200. data/spec/unit/policyfile/storage_config_spec.rb +3 -7
  201. data/spec/unit/policyfile/undo_record_spec.rb +21 -23
  202. data/spec/unit/policyfile/undo_stack_spec.rb +5 -6
  203. data/spec/unit/policyfile/uploader_spec.rb +73 -75
  204. data/spec/unit/policyfile_demands_spec.rb +93 -99
  205. data/spec/unit/policyfile_evaluation_spec.rb +14 -14
  206. data/spec/unit/policyfile_lock_build_spec.rb +64 -65
  207. data/spec/unit/policyfile_lock_install_spec.rb +5 -6
  208. data/spec/unit/policyfile_lock_serialization_spec.rb +14 -15
  209. data/spec/unit/policyfile_lock_validation_spec.rb +17 -20
  210. data/spec/unit/policyfile_services/clean_policies_spec.rb +16 -16
  211. data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +26 -29
  212. data/spec/unit/policyfile_services/export_repo_spec.rb +3 -6
  213. data/spec/unit/policyfile_services/install_spec.rb +5 -7
  214. data/spec/unit/policyfile_services/push_archive_spec.rb +4 -8
  215. data/spec/unit/policyfile_services/push_spec.rb +3 -3
  216. data/spec/unit/policyfile_services/rm_policy_group_spec.rb +16 -20
  217. data/spec/unit/policyfile_services/rm_policy_spec.rb +14 -17
  218. data/spec/unit/policyfile_services/show_policy_spec.rb +78 -80
  219. data/spec/unit/policyfile_services/undelete_spec.rb +5 -7
  220. data/spec/unit/policyfile_services/update_attributes_spec.rb +34 -35
  221. data/spec/unit/service_exception_inspectors/base_spec.rb +2 -4
  222. data/spec/unit/service_exception_inspectors/http_spec.rb +9 -11
  223. data/spec/unit/shell_out_spec.rb +2 -2
  224. data/spec/unit/tasks/helpers_spec.rb +2 -2
  225. data/tasks/bin/bundle-platform +1 -1
  226. data/tasks/bundle_util.rb +1 -1
  227. data/tasks/dependencies.rb +21 -7
  228. data/tasks/gemfile_util.rb +1 -1
  229. data/tasks/helpers.rb +2 -2
  230. data/tasks/version.rb +26 -1
  231. data/version_policy.rb +6 -6
  232. metadata +3 -3
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'shared/command_with_ui_object'
20
- require 'chef-dk/command/push_archive'
18
+ require "spec_helper"
19
+ require "shared/command_with_ui_object"
20
+ require "chef-dk/command/push_archive"
21
21
 
22
22
  describe ChefDK::Command::PushArchive do
23
23
 
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'shared/command_with_ui_object'
20
- require 'chef-dk/command/push'
18
+ require "spec_helper"
19
+ require "shared/command_with_ui_object"
20
+ require "chef-dk/command/push"
21
21
 
22
22
  describe ChefDK::Command::Push do
23
23
 
@@ -158,7 +158,7 @@ describe ChefDK::Command::Push do
158
158
  it "describes the error" do
159
159
  command.run(params)
160
160
 
161
- expected_output=<<-E
161
+ expected_output = <<-E
162
162
  Error: push failed
163
163
  Reason: (StandardError) some operation failed
164
164
 
@@ -177,7 +177,7 @@ E
177
177
 
178
178
  command.run(params)
179
179
 
180
- expected_output=<<-E
180
+ expected_output = <<-E
181
181
  Error: push failed
182
182
  Reason: (StandardError) some operation failed
183
183
 
@@ -196,4 +196,3 @@ E
196
196
  end
197
197
 
198
198
  end
199
-
@@ -15,12 +15,12 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/command/shell_init'
18
+ require "spec_helper"
19
+ require "chef-dk/command/shell_init"
20
20
 
21
21
  describe ChefDK::Command::ShellInit do
22
22
 
23
- let(:expected_path) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV['PATH'], git_bin_dir].join(File::PATH_SEPARATOR) }
23
+ let(:expected_path) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV["PATH"], git_bin_dir].join(File::PATH_SEPARATOR) }
24
24
  let(:stdout_io) { StringIO.new }
25
25
  let(:stderr_io) { StringIO.new }
26
26
 
@@ -32,7 +32,7 @@ describe ChefDK::Command::ShellInit do
32
32
  end
33
33
 
34
34
  shared_context "shell init script" do |shell|
35
- let(:user_bin_dir) { File.expand_path(File.join(Gem.user_dir, 'bin')) }
35
+ let(:user_bin_dir) { File.expand_path(File.join(Gem.user_dir, "bin")) }
36
36
  let(:expected_gem_root) { Gem.default_dir.to_s }
37
37
  let(:expected_gem_home) { Gem.user_dir }
38
38
  let(:expected_gem_path) { Gem.path.join(File::PATH_SEPARATOR) }
@@ -60,7 +60,7 @@ describe ChefDK::Command::ShellInit do
60
60
  expect(stdout_io.string).to include(expected_environment_commands)
61
61
  end
62
62
 
63
- it "does not emit any empty lines", :if => ["powershell", "posh"].include?(shell) do
63
+ it "does not emit any empty lines", :if => %w{powershell posh}.include?(shell) do
64
64
  command_instance.run(argv)
65
65
  stdout_io.string.each_line do |s|
66
66
  expect(s.strip).not_to be_empty
@@ -86,7 +86,7 @@ describe ChefDK::Command::ShellInit do
86
86
  expect(stdout_io.string).to include(expected_environment_commands)
87
87
  end
88
88
 
89
- it "does not emit any empty lines", :if => ["powershell", "posh"].include?(shell) do
89
+ it "does not emit any empty lines", :if => %w{powershell posh}.include?(shell) do
90
90
  command_instance.run(argv)
91
91
  stdout_io.string.each_line do |s|
92
92
  expect(s.strip).not_to be_empty
@@ -97,7 +97,7 @@ describe ChefDK::Command::ShellInit do
97
97
 
98
98
  shared_examples "a posix shell script" do |shell|
99
99
  before do
100
- stub_const("File::PATH_SEPARATOR", ':')
100
+ stub_const("File::PATH_SEPARATOR", ":")
101
101
  end
102
102
 
103
103
  let(:expected_environment_commands) do
@@ -113,7 +113,7 @@ EOH
113
113
 
114
114
  shared_examples "a powershell script" do |shell|
115
115
  before do
116
- stub_const("File::PATH_SEPARATOR", ';')
116
+ stub_const("File::PATH_SEPARATOR", ";")
117
117
  end
118
118
 
119
119
  let(:expected_environment_commands) do
@@ -141,7 +141,7 @@ EOH
141
141
  "exec" => "Runs the command in context of the embedded ruby",
142
142
  "env" => "Prints environment variables used by ChefDK",
143
143
  "gem" => "Runs the `gem` command in context of the embedded ruby",
144
- "generate" => "Generate a new app, cookbook, or component"
144
+ "generate" => "Generate a new app, cookbook, or component",
145
145
  }
146
146
  end
147
147
 
@@ -189,7 +189,7 @@ END_COMPLETION
189
189
  "exec" => "Runs the command in context of the embedded ruby",
190
190
  "env" => "Prints environment variables used by ChefDK",
191
191
  "gem" => "Runs the `gem` command in context of the embedded ruby",
192
- "generate" => "Generate a new app, cookbook, or component"
192
+ "generate" => "Generate a new app, cookbook, or component",
193
193
  }
194
194
  end
195
195
 
@@ -242,11 +242,11 @@ compdef _chef chef
242
242
  end
243
243
  end
244
244
 
245
- context 'for fish' do
245
+ context "for fish" do
246
246
  before do
247
- stub_const('File::PATH_SEPARATOR', ':')
247
+ stub_const("File::PATH_SEPARATOR", ":")
248
248
  end
249
- let(:expected_path) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV['PATH'], git_bin_dir].join(':').split(':').join('" "') }
249
+ let(:expected_path) { [omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV["PATH"], git_bin_dir].join(":").split(":").join('" "') }
250
250
  let(:expected_environment_commands) do
251
251
  <<-EOH
252
252
  set -gx PATH "#{expected_path}" 2>/dev/null;
@@ -256,7 +256,7 @@ set -gx GEM_PATH "#{expected_gem_path}";
256
256
  EOH
257
257
  end
258
258
 
259
- include_context 'shell init script', 'fish'
259
+ include_context "shell init script", "fish"
260
260
 
261
261
  describe "generating auto-complete" do
262
262
 
@@ -265,7 +265,7 @@ EOH
265
265
  "exec" => "Runs the command in context of the embedded ruby",
266
266
  "env" => "Prints environment variables used by ChefDK",
267
267
  "gem" => "Runs the `gem` command in context of the embedded ruby",
268
- "generate" => "Generate a new app, cookbook, or component"
268
+ "generate" => "Generate a new app, cookbook, or component",
269
269
  }
270
270
  end
271
271
 
@@ -307,7 +307,7 @@ END_COMPLETION
307
307
  end
308
308
  end
309
309
 
310
- ['powershell', 'posh'].each do |shell|
310
+ %w{powershell posh}.each do |shell|
311
311
  context "for #{shell}" do
312
312
  it_behaves_like "a powershell script", shell
313
313
  end
@@ -326,7 +326,7 @@ END_COMPLETION
326
326
 
327
327
  context "when an unsupported shell is specified" do
328
328
 
329
- let(:argv) { ['nosuchsh'] }
329
+ let(:argv) { ["nosuchsh"] }
330
330
 
331
331
  it "exits with an error message" do
332
332
  expect(command_instance.run(argv)).to eq(1)
@@ -336,6 +336,4 @@ END_COMPLETION
336
336
 
337
337
  end
338
338
 
339
-
340
339
  end
341
-
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'shared/command_with_ui_object'
20
- require 'chef-dk/command/show_policy'
18
+ require "spec_helper"
19
+ require "shared/command_with_ui_object"
20
+ require "chef-dk/command/show_policy"
21
21
 
22
22
  describe ChefDK::Command::ShowPolicy do
23
23
 
@@ -50,7 +50,7 @@ describe ChefDK::Command::ShowPolicy do
50
50
 
51
51
  context "when given a path to the config" do
52
52
 
53
- let(:params) { %w[ -c ~/otherstuff/config.rb ] }
53
+ let(:params) { %w{ -c ~/otherstuff/config.rb } }
54
54
 
55
55
  let(:config_arg) { "~/otherstuff/config.rb" }
56
56
 
@@ -101,7 +101,7 @@ describe ChefDK::Command::ShowPolicy do
101
101
 
102
102
  context "when --show-orphans is given" do
103
103
 
104
- let(:params) { %w[ -o ] }
104
+ let(:params) { %w{ -o } }
105
105
 
106
106
  it "enables displaying orphans" do
107
107
  expect(command.show_orphans?).to be(true)
@@ -112,7 +112,7 @@ describe ChefDK::Command::ShowPolicy do
112
112
 
113
113
  context "when given a policy name" do
114
114
 
115
- let(:params) { %w[ appserver ] }
115
+ let(:params) { %w{ appserver } }
116
116
 
117
117
  it "is not configured to show all policies" do
118
118
  expect(show_policy_service.show_all_policies?).to be(false)
@@ -127,7 +127,7 @@ describe ChefDK::Command::ShowPolicy do
127
127
 
128
128
  context "when given a policy name and a policy group name" do
129
129
 
130
- let(:params) { %w[ appserver production ] }
130
+ let(:params) { %w{ appserver production } }
131
131
 
132
132
  it "is not configured to show all policies" do
133
133
  expect(show_policy_service.show_all_policies?).to be(false)
@@ -159,7 +159,7 @@ describe ChefDK::Command::ShowPolicy do
159
159
 
160
160
  context "when given too many arguments" do
161
161
 
162
- let(:params) { %w[ appserver policygroup wut-is-this ] }
162
+ let(:params) { %w{ appserver policygroup wut-is-this } }
163
163
 
164
164
  it "shows usage and exits" do
165
165
  expect(command.run(params)).to eq(1)
@@ -188,7 +188,7 @@ describe ChefDK::Command::ShowPolicy do
188
188
  it "prints a debugging message and exits non-zero" do
189
189
  expect(command.run([])).to eq(1)
190
190
 
191
- expected_output=<<-E
191
+ expected_output = <<-E
192
192
  Error: Failed to list policies
193
193
  Reason: (StandardError) some operation failed
194
194
 
@@ -201,9 +201,9 @@ E
201
201
 
202
202
  it "includes the backtrace in the error" do
203
203
 
204
- command.run(%w[ -D ])
204
+ command.run(%w{ -D })
205
205
 
206
- expected_output=<<-E
206
+ expected_output = <<-E
207
207
  Error: Failed to list policies
208
208
  Reason: (StandardError) some operation failed
209
209
 
@@ -232,4 +232,3 @@ E
232
232
 
233
233
  end
234
234
  end
235
-
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'shared/command_with_ui_object'
20
- require 'chef-dk/command/undelete'
18
+ require "spec_helper"
19
+ require "shared/command_with_ui_object"
20
+ require "chef-dk/command/undelete"
21
21
 
22
22
  describe ChefDK::Command::Undelete do
23
23
 
@@ -53,7 +53,7 @@ describe ChefDK::Command::Undelete do
53
53
 
54
54
  context "when given a path to the config" do
55
55
 
56
- let(:params) { %w[ -c ~/otherstuff/config.rb ] }
56
+ let(:params) { %w{ -c ~/otherstuff/config.rb } }
57
57
 
58
58
  let(:config_arg) { "~/otherstuff/config.rb" }
59
59
 
@@ -99,7 +99,7 @@ describe ChefDK::Command::Undelete do
99
99
 
100
100
  context "when --last is given" do
101
101
 
102
- let(:params) { %w[ -l ] }
102
+ let(:params) { %w{ -l } }
103
103
 
104
104
  it "disables list mode" do
105
105
  expect(command.list_undo_records?).to be(false)
@@ -131,7 +131,7 @@ describe ChefDK::Command::Undelete do
131
131
 
132
132
  context "when exclusive options --last and --id are given" do
133
133
 
134
- let(:params) { %w[ --last --id foo ] }
134
+ let(:params) { %w{ --last --id foo } }
135
135
 
136
136
  it "emits an error message saying they are exclusive and exits" do
137
137
  expect(ui.output).to include("Error: options --last and --id cannot both be given.")
@@ -143,7 +143,6 @@ describe ChefDK::Command::Undelete do
143
143
  end
144
144
  end
145
145
 
146
-
147
146
  describe "running the command" do
148
147
 
149
148
  let(:ui) { TestHelpers::TestUI.new }
@@ -155,7 +154,7 @@ describe ChefDK::Command::Undelete do
155
154
 
156
155
  context "when given too many arguments" do
157
156
 
158
- let(:params) { %w[ extra-thing ] }
157
+ let(:params) { %w{ extra-thing } }
159
158
 
160
159
  it "shows usage and exits" do
161
160
  expect(command.run(params)).to eq(1)
@@ -176,7 +175,7 @@ describe ChefDK::Command::Undelete do
176
175
 
177
176
  context "when the undelete service raises an exception" do
178
177
 
179
- let(:params) { %w[ --last ] }
178
+ let(:params) { %w{ --last } }
180
179
 
181
180
  let(:backtrace) { caller[0...3] }
182
181
 
@@ -197,7 +196,7 @@ describe ChefDK::Command::Undelete do
197
196
  it "prints a debugging message and exits non-zero" do
198
197
  expect(command.run(params)).to eq(1)
199
198
 
200
- expected_output=<<-E
199
+ expected_output = <<-E
201
200
  Error: Failed to undelete.
202
201
  Reason: (StandardError) some operation failed
203
202
 
@@ -210,9 +209,9 @@ E
210
209
 
211
210
  it "includes the backtrace in the error" do
212
211
 
213
- command.run(params + %w[ -D ])
212
+ command.run(params + %w{ -D })
214
213
 
215
- expected_output=<<-E
214
+ expected_output = <<-E
216
215
  Error: Failed to undelete.
217
216
  Reason: (StandardError) some operation failed
218
217
 
@@ -229,7 +228,7 @@ E
229
228
 
230
229
  context "when the undelete service executes successfully" do
231
230
 
232
- let(:params) { %w[ --last ] }
231
+ let(:params) { %w{ --last } }
233
232
 
234
233
  before do
235
234
  expect(command.undelete_service).to receive(:run)
@@ -243,4 +242,3 @@ E
243
242
 
244
243
  end
245
244
  end
246
-
@@ -15,9 +15,9 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'shared/command_with_ui_object'
20
- require 'chef-dk/command/update'
18
+ require "spec_helper"
19
+ require "shared/command_with_ui_object"
20
+ require "chef-dk/command/update"
21
21
 
22
22
  describe ChefDK::Command::Update do
23
23
 
@@ -54,7 +54,7 @@ describe ChefDK::Command::Update do
54
54
 
55
55
  context "when an explicit config file path is given" do
56
56
 
57
- let(:params) { %w[ -c ~/.chef/alternate_config.rb ] }
57
+ let(:params) { %w{ -c ~/.chef/alternate_config.rb } }
58
58
 
59
59
  let(:chef_config_loader) { instance_double("Chef::WorkstationConfigLoader") }
60
60
 
@@ -162,7 +162,7 @@ describe ChefDK::Command::Update do
162
162
  end
163
163
 
164
164
  it "displays the exception and cause" do
165
- expected_error_text=<<-E
165
+ expected_error_text = <<-E
166
166
  Error: install failed
167
167
  Reason: (StandardError) some operation failed
168
168
 
@@ -177,7 +177,7 @@ E
177
177
  let(:params) { ["-D"] }
178
178
 
179
179
  it "displays the exception and cause with backtrace" do
180
- expected_error_text=<<-E
180
+ expected_error_text = <<-E
181
181
  Error: install failed
182
182
  Reason: (StandardError) some operation failed
183
183
 
@@ -240,7 +240,7 @@ E
240
240
  end
241
241
 
242
242
  it "displays the exception and cause" do
243
- expected_error_text=<<-E
243
+ expected_error_text = <<-E
244
244
  Error: Failed to update Policyfile lock
245
245
  Reason: (StandardError) some operation failed
246
246
 
@@ -255,7 +255,7 @@ E
255
255
  let(:params) { ["-a", "-D"] }
256
256
 
257
257
  it "displays the exception and cause with backtrace" do
258
- expected_error_text=<<-E
258
+ expected_error_text = <<-E
259
259
  Error: Failed to update Policyfile lock
260
260
  Reason: (StandardError) some operation failed
261
261
 
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require 'spec_helper'
19
- require 'chef-dk/command/verify'
18
+ require "spec_helper"
19
+ require "chef-dk/command/verify"
20
20
 
21
21
  module Gem
22
22
 
@@ -80,13 +80,13 @@ describe ChefDK::Command::Verify do
80
80
  end
81
81
 
82
82
  it "should raise OmnibusInstallNotFound if directory is not looking like omnibus" do
83
- allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path,".rbenv/versions/2.1.1/bin/ruby"))
84
- expect{command_instance.omnibus_apps_dir}.to raise_error(ChefDK::OmnibusInstallNotFound)
83
+ allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path, ".rbenv/versions/2.1.1/bin/ruby"))
84
+ expect { command_instance.omnibus_apps_dir }.to raise_error(ChefDK::OmnibusInstallNotFound)
85
85
  end
86
86
 
87
87
  it "raises OmnibusInstallNotFound if omnibus directory doesn't exist" do
88
- allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path,"eg_omnibus_dir/missing_apps/embedded/bin/ruby"))
89
- expect{command_instance.omnibus_apps_dir}.to raise_error(ChefDK::OmnibusInstallNotFound)
88
+ allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path, "eg_omnibus_dir/missing_apps/embedded/bin/ruby"))
89
+ expect { command_instance.omnibus_apps_dir }.to raise_error(ChefDK::OmnibusInstallNotFound)
90
90
  end
91
91
 
92
92
  context "and a component's gem is not installed" do
@@ -98,8 +98,8 @@ describe ChefDK::Command::Verify do
98
98
  end
99
99
 
100
100
  it "raises MissingComponentError when a component doesn't exist" do
101
- allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path,"eg_omnibus_dir/missing_component/embedded/bin/ruby"))
102
- expect{command_instance.validate_components!}.to raise_error(ChefDK::MissingComponentError)
101
+ allow(Gem).to receive(:ruby).and_return(File.join(fixtures_path, "eg_omnibus_dir/missing_component/embedded/bin/ruby"))
102
+ expect { command_instance.validate_components! }.to raise_error(ChefDK::MissingComponentError)
103
103
  end
104
104
  end
105
105
  end
@@ -111,11 +111,11 @@ describe ChefDK::Command::Verify do
111
111
  def run_unit_test
112
112
  # Set rubyopt to empty to prevent bundler from infecting the ruby
113
113
  # subcommands (and loading a bunch of extra gems).
114
- lambda { |_self| sh("#{Gem.real_ruby} verify_me", env: { "RUBYOPT" => ""}) }
114
+ lambda { |_self| sh("#{Gem.real_ruby} verify_me", env: { "RUBYOPT" => "" }) }
115
115
  end
116
116
 
117
117
  def run_integration_test
118
- lambda { |_self| sh("#{Gem.real_ruby} integration_test", env: { "RUBYOPT" => ""}) }
118
+ lambda { |_self| sh("#{Gem.real_ruby} integration_test", env: { "RUBYOPT" => "" }) }
119
119
  end
120
120
 
121
121
  let(:all_tests_ok) do