chef 12.13.37-universal-mingw32 → 12.14.60-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (338) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +48 -95
  3. data/Gemfile +6 -1
  4. data/README.md +9 -11
  5. data/VERSION +1 -1
  6. data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +0 -1
  7. data/acceptance/Gemfile +4 -7
  8. data/acceptance/Gemfile.lock +59 -92
  9. data/acceptance/basics/test/integration/helpers/serverspec/Gemfile +8 -0
  10. data/acceptance/data-collector/test/integration/helpers/serverspec/Gemfile +8 -0
  11. data/acceptance/fips/test/integration/fips-integration/serverspec/Gemfile +6 -0
  12. data/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile +4 -0
  13. data/chef.gemspec +3 -2
  14. data/lib/chef/application/client.rb +4 -4
  15. data/lib/chef/application/solo.rb +2 -2
  16. data/lib/chef/chef_fs/command_line.rb +36 -34
  17. data/lib/chef/chef_fs/data_handler/data_handler_base.rb +2 -2
  18. data/lib/chef/chef_fs/file_pattern.rb +1 -1
  19. data/lib/chef/chef_fs/file_system.rb +139 -137
  20. data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +2 -6
  21. data/lib/chef/cookbook/cookbook_version_loader.rb +27 -22
  22. data/lib/chef/cookbook/metadata.rb +1 -1
  23. data/lib/chef/cookbook/synchronizer.rb +3 -3
  24. data/lib/chef/cookbook_site_streaming_uploader.rb +3 -3
  25. data/lib/chef/cookbook_uploader.rb +1 -1
  26. data/lib/chef/cookbook_version.rb +6 -6
  27. data/lib/chef/dsl/powershell.rb +1 -1
  28. data/lib/chef/event_dispatch/base.rb +2 -2
  29. data/lib/chef/exceptions.rb +1 -1
  30. data/lib/chef/file_cache.rb +1 -1
  31. data/lib/chef/formatters/base.rb +2 -2
  32. data/lib/chef/formatters/doc.rb +2 -2
  33. data/lib/chef/http.rb +48 -18
  34. data/lib/chef/http/auth_credentials.rb +1 -1
  35. data/lib/chef/http/basic_client.rb +11 -2
  36. data/lib/chef/http/socketless_chef_zero_client.rb +2 -2
  37. data/lib/chef/key.rb +55 -56
  38. data/lib/chef/knife.rb +70 -61
  39. data/lib/chef/knife/client_delete.rb +2 -2
  40. data/lib/chef/knife/cookbook_bulk_delete.rb +1 -1
  41. data/lib/chef/knife/cookbook_show.rb +1 -1
  42. data/lib/chef/knife/core/gem_glob_loader.rb +3 -3
  43. data/lib/chef/knife/search.rb +2 -2
  44. data/lib/chef/knife/ssh.rb +19 -21
  45. data/lib/chef/knife/status.rb +2 -2
  46. data/lib/chef/mixin/command/unix.rb +2 -2
  47. data/lib/chef/mixin/powershell_type_coercions.rb +1 -1
  48. data/lib/chef/mixin/properties.rb +3 -0
  49. data/lib/chef/mixin/securable.rb +2 -2
  50. data/lib/chef/mixin/shell_out.rb +30 -0
  51. data/lib/chef/mixin/uris.rb +2 -1
  52. data/lib/chef/mixin/windows_architecture_helper.rb +3 -4
  53. data/lib/chef/monkey_patches/webrick-utils.rb +2 -2
  54. data/lib/chef/monologger.rb +1 -1
  55. data/lib/chef/node.rb +2 -2
  56. data/lib/chef/node/attribute.rb +3 -3
  57. data/lib/chef/platform/provider_mapping.rb +5 -2
  58. data/lib/chef/property.rb +14 -3
  59. data/lib/chef/provider/apt_repository.rb +3 -7
  60. data/lib/chef/provider/apt_update.rb +4 -6
  61. data/lib/chef/provider/cron.rb +1 -2
  62. data/lib/chef/provider/dsc_script.rb +4 -4
  63. data/lib/chef/provider/group/usermod.rb +1 -1
  64. data/lib/chef/provider/link.rb +10 -3
  65. data/lib/chef/provider/osx_profile.rb +10 -10
  66. data/lib/chef/provider/package.rb +2 -12
  67. data/lib/chef/provider/package/rubygems.rb +17 -16
  68. data/lib/chef/provider/package/windows.rb +2 -0
  69. data/lib/chef/provider/package/windows/exe.rb +1 -1
  70. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +0 -2
  71. data/lib/chef/provider/package/yum/rpm_utils.rb +8 -8
  72. data/lib/chef/provider/package/yum/yum_cache.rb +1 -1
  73. data/lib/chef/provider/remote_file/ftp.rb +2 -2
  74. data/lib/chef/provider/remote_file/sftp.rb +2 -2
  75. data/lib/chef/provider/service/debian.rb +2 -2
  76. data/lib/chef/provider/service/simple.rb +4 -3
  77. data/lib/chef/provider/service/solaris.rb +1 -1
  78. data/lib/chef/provider/service/systemd.rb +2 -2
  79. data/lib/chef/provider/service/upstart.rb +8 -5
  80. data/lib/chef/provider/support/yum_repo.erb +125 -0
  81. data/lib/chef/provider/systemd_unit.rb +11 -2
  82. data/lib/chef/provider/template_finder.rb +1 -1
  83. data/lib/chef/provider/user.rb +20 -16
  84. data/lib/chef/provider/user/aix.rb +5 -2
  85. data/lib/chef/provider/user/dscl.rb +1 -0
  86. data/lib/chef/provider/user/linux.rb +128 -0
  87. data/lib/chef/provider/user/pw.rb +2 -1
  88. data/lib/chef/provider/user/solaris.rb +3 -2
  89. data/lib/chef/provider/user/useradd.rb +5 -4
  90. data/lib/chef/provider/user/windows.rb +1 -1
  91. data/lib/chef/provider/windows_script.rb +5 -2
  92. data/lib/chef/provider/yum_repository.rb +121 -0
  93. data/lib/chef/providers.rb +4 -2
  94. data/lib/chef/resource.rb +7 -9
  95. data/lib/chef/resource/conditional.rb +9 -1
  96. data/lib/chef/resource/launchd.rb +1 -1
  97. data/lib/chef/resource/user.rb +3 -3
  98. data/lib/chef/resource/user/aix_user.rb +31 -0
  99. data/lib/chef/resource/user/dscl_user.rb +31 -0
  100. data/lib/chef/resource/user/linux_user.rb +51 -0
  101. data/lib/chef/resource/user/pw_user.rb +31 -0
  102. data/lib/chef/resource/user/solaris_user.rb +31 -0
  103. data/lib/chef/resource/user/windows_user.rb +31 -0
  104. data/lib/chef/resource/yum_package.rb +13 -12
  105. data/lib/chef/resource/yum_repository.rb +76 -0
  106. data/lib/chef/resource_builder.rb +1 -1
  107. data/lib/chef/resource_collection/stepable_iterator.rb +1 -3
  108. data/lib/chef/resource_reporter.rb +5 -5
  109. data/lib/chef/resources.rb +7 -0
  110. data/lib/chef/run_context.rb +5 -3
  111. data/lib/chef/run_context/cookbook_compiler.rb +3 -2
  112. data/lib/chef/run_list.rb +2 -2
  113. data/lib/chef/search/query.rb +11 -8
  114. data/lib/chef/shell/ext.rb +2 -2
  115. data/lib/chef/shell/shell_session.rb +1 -1
  116. data/lib/chef/util/dsc/configuration_generator.rb +1 -1
  117. data/lib/chef/util/powershell/cmdlet.rb +5 -2
  118. data/lib/chef/util/selinux.rb +1 -1
  119. data/lib/chef/version.rb +1 -1
  120. data/lib/chef/version_class.rb +2 -2
  121. data/lib/chef/version_constraint.rb +2 -2
  122. data/lib/chef/win32/api/error.rb +2 -2
  123. data/lib/chef/win32/api/net.rb +1 -1
  124. data/lib/chef/win32/eventlog.rb +1 -1
  125. data/lib/chef/win32/net.rb +1 -1
  126. data/lib/chef/win32/security/sid.rb +1 -1
  127. data/spec/functional/assets/testchefsubsys +2 -3
  128. data/spec/functional/event_loggers/windows_eventlog_spec.rb +11 -8
  129. data/spec/functional/file_content_management/deploy_strategies_spec.rb +1 -1
  130. data/spec/functional/http/simple_spec.rb +2 -2
  131. data/spec/functional/knife/cookbook_delete_spec.rb +5 -5
  132. data/spec/functional/knife/exec_spec.rb +6 -6
  133. data/spec/functional/knife/ssh_spec.rb +4 -4
  134. data/spec/functional/notifications_spec.rb +2 -2
  135. data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +2 -2
  136. data/spec/functional/rebooter_spec.rb +5 -5
  137. data/spec/functional/resource/bash_spec.rb +2 -2
  138. data/spec/functional/resource/deploy_revision_spec.rb +1 -1
  139. data/spec/functional/resource/dpkg_package_spec.rb +2 -2
  140. data/spec/functional/resource/dsc_resource_spec.rb +5 -5
  141. data/spec/functional/resource/dsc_script_spec.rb +27 -22
  142. data/spec/functional/resource/env_spec.rb +4 -4
  143. data/spec/functional/resource/execute_spec.rb +4 -4
  144. data/spec/functional/resource/group_spec.rb +20 -8
  145. data/spec/functional/resource/link_spec.rb +34 -0
  146. data/spec/functional/resource/ohai_spec.rb +6 -6
  147. data/spec/functional/resource/reboot_spec.rb +2 -2
  148. data/spec/functional/resource/remote_file_spec.rb +16 -7
  149. data/spec/functional/resource/user/dscl_spec.rb +3 -3
  150. data/spec/functional/resource/user/useradd_spec.rb +32 -26
  151. data/spec/functional/resource/windows_service_spec.rb +15 -15
  152. data/spec/functional/rest_spec.rb +2 -2
  153. data/spec/functional/run_lock_spec.rb +9 -9
  154. data/spec/functional/tiny_server_spec.rb +9 -8
  155. data/spec/functional/win32/crypto_spec.rb +1 -1
  156. data/spec/functional/win32/security_spec.rb +8 -8
  157. data/spec/integration/client/client_spec.rb +6 -4
  158. data/spec/integration/knife/chef_repo_path_spec.rb +70 -1
  159. data/spec/integration/knife/upload_spec.rb +1 -1
  160. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +6 -6
  161. data/spec/integration/recipes/noop_resource_spec.rb +4 -4
  162. data/spec/integration/recipes/provider_choice.rb +3 -3
  163. data/spec/integration/recipes/recipe_dsl_spec.rb +318 -317
  164. data/spec/integration/recipes/resource_action_spec.rb +50 -54
  165. data/spec/integration/recipes/resource_converge_if_changed_spec.rb +34 -34
  166. data/spec/integration/recipes/resource_load_spec.rb +24 -24
  167. data/spec/integration/solo/solo_spec.rb +21 -30
  168. data/spec/scripts/ssl-serve.rb +1 -1
  169. data/spec/spec_helper.rb +1 -0
  170. data/spec/stress/win32/security_spec.rb +4 -4
  171. data/spec/support/chef_helpers.rb +22 -0
  172. data/spec/support/platform_helpers.rb +5 -1
  173. data/spec/support/shared/context/client.rb +3 -2
  174. data/spec/support/shared/functional/file_resource.rb +5 -4
  175. data/spec/support/shared/functional/http.rb +16 -16
  176. data/spec/support/shared/functional/securable_resource.rb +5 -5
  177. data/spec/support/shared/functional/win32_service.rb +5 -7
  178. data/spec/support/shared/integration/app_server_support.rb +1 -3
  179. data/spec/support/shared/integration/knife_support.rb +0 -2
  180. data/spec/support/shared/shared_examples.rb +2 -2
  181. data/spec/support/shared/unit/api_versioning.rb +2 -2
  182. data/spec/support/shared/unit/application_dot_d.rb +9 -6
  183. data/spec/support/shared/unit/provider/file.rb +2 -2
  184. data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +49 -80
  185. data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -2
  186. data/spec/support/shared/unit/script_resource.rb +4 -4
  187. data/spec/support/shared/unit/user_and_client_shared.rb +4 -4
  188. data/spec/tiny_server.rb +51 -66
  189. data/spec/unit/api_client_v1_spec.rb +2 -2
  190. data/spec/unit/application_spec.rb +1 -1
  191. data/spec/unit/audit/audit_event_proxy_spec.rb +34 -27
  192. data/spec/unit/audit/audit_reporter_spec.rb +32 -23
  193. data/spec/unit/audit/control_group_data_spec.rb +19 -14
  194. data/spec/unit/chef_class_spec.rb +1 -1
  195. data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +1 -1
  196. data/spec/unit/chef_fs/diff_spec.rb +4 -4
  197. data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +4 -4
  198. data/spec/unit/chef_fs/file_system_spec.rb +2 -2
  199. data/spec/unit/chef_fs/parallelizer.rb +5 -7
  200. data/spec/unit/cookbook/metadata_spec.rb +98 -98
  201. data/spec/unit/cookbook/synchronizer_spec.rb +7 -0
  202. data/spec/unit/cookbook_loader_spec.rb +24 -24
  203. data/spec/unit/cookbook_version_file_specificity_spec.rb +8 -8
  204. data/spec/unit/daemon_spec.rb +1 -1
  205. data/spec/unit/data_bag_item_spec.rb +18 -18
  206. data/spec/unit/data_bag_spec.rb +2 -2
  207. data/spec/unit/data_collector/messages/helpers_spec.rb +9 -9
  208. data/spec/unit/data_collector/messages_spec.rb +2 -2
  209. data/spec/unit/data_collector_spec.rb +19 -19
  210. data/spec/unit/dsl/audit_spec.rb +3 -3
  211. data/spec/unit/dsl/data_query_spec.rb +3 -2
  212. data/spec/unit/dsl/declare_resource_spec.rb +10 -10
  213. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +3 -2
  214. data/spec/unit/encrypted_data_bag_item_spec.rb +3 -2
  215. data/spec/unit/environment_spec.rb +6 -6
  216. data/spec/unit/event_dispatch/dispatcher_spec.rb +2 -2
  217. data/spec/unit/file_access_control_spec.rb +3 -3
  218. data/spec/unit/file_content_management/tempfile_spec.rb +2 -2
  219. data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +2 -2
  220. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +2 -2
  221. data/spec/unit/http/basic_client_spec.rb +20 -0
  222. data/spec/unit/http/validate_content_length_spec.rb +8 -8
  223. data/spec/unit/http_spec.rb +14 -0
  224. data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +2 -2
  225. data/spec/unit/knife/bootstrap/client_builder_spec.rb +2 -2
  226. data/spec/unit/knife/bootstrap_spec.rb +8 -6
  227. data/spec/unit/knife/client_bulk_delete_spec.rb +8 -8
  228. data/spec/unit/knife/client_edit_spec.rb +2 -2
  229. data/spec/unit/knife/configure_client_spec.rb +2 -2
  230. data/spec/unit/knife/cookbook_metadata_spec.rb +4 -4
  231. data/spec/unit/knife/cookbook_site_install_spec.rb +6 -5
  232. data/spec/unit/knife/cookbook_site_share_spec.rb +2 -2
  233. data/spec/unit/knife/core/hashed_command_loader_spec.rb +5 -4
  234. data/spec/unit/knife/core/node_editor_spec.rb +3 -3
  235. data/spec/unit/knife/core/ui_spec.rb +2 -2
  236. data/spec/unit/knife/data_bag_from_file_spec.rb +4 -3
  237. data/spec/unit/knife/data_bag_show_spec.rb +3 -2
  238. data/spec/unit/knife/key_create_spec.rb +14 -14
  239. data/spec/unit/knife/key_delete_spec.rb +2 -2
  240. data/spec/unit/knife/key_edit_spec.rb +16 -16
  241. data/spec/unit/knife/key_list_spec.rb +6 -6
  242. data/spec/unit/knife/key_show_spec.rb +4 -4
  243. data/spec/unit/knife/status_spec.rb +3 -2
  244. data/spec/unit/knife/user_create_spec.rb +4 -4
  245. data/spec/unit/knife_spec.rb +7 -6
  246. data/spec/unit/lwrp_spec.rb +6 -6
  247. data/spec/unit/mixin/api_version_request_handling_spec.rb +2 -2
  248. data/spec/unit/mixin/command_spec.rb +17 -14
  249. data/spec/unit/mixin/deprecation_spec.rb +1 -1
  250. data/spec/unit/mixin/homebrew_user_spec.rb +2 -2
  251. data/spec/unit/mixin/params_validate_spec.rb +53 -52
  252. data/spec/unit/mixin/powershell_out_spec.rb +2 -2
  253. data/spec/unit/mixin/powershell_type_coercions_spec.rb +2 -2
  254. data/spec/unit/mixin/shell_out_spec.rb +1 -1
  255. data/spec/unit/mixin/xml_escape_spec.rb +3 -3
  256. data/spec/unit/node_spec.rb +2 -2
  257. data/spec/unit/platform/query_helpers_spec.rb +3 -3
  258. data/spec/unit/property_spec.rb +4 -4
  259. data/spec/unit/provider/cookbook_file_spec.rb +4 -4
  260. data/spec/unit/provider/cron/unix_spec.rb +4 -4
  261. data/spec/unit/provider/cron_spec.rb +2 -2
  262. data/spec/unit/provider/deploy_spec.rb +8 -8
  263. data/spec/unit/provider/dsc_resource_spec.rb +11 -10
  264. data/spec/unit/provider/dsc_script_spec.rb +9 -9
  265. data/spec/unit/provider/env/windows_spec.rb +8 -8
  266. data/spec/unit/provider/file/content_spec.rb +6 -6
  267. data/spec/unit/provider/file_spec.rb +4 -4
  268. data/spec/unit/provider/launchd_spec.rb +2 -1
  269. data/spec/unit/provider/link_spec.rb +155 -0
  270. data/spec/unit/provider/mount/mount_spec.rb +5 -5
  271. data/spec/unit/provider/mount/solaris_spec.rb +48 -48
  272. data/spec/unit/provider/osx_profile_spec.rb +6 -0
  273. data/spec/unit/provider/package/chocolatey_spec.rb +4 -4
  274. data/spec/unit/provider/package/freebsd/port_spec.rb +4 -4
  275. data/spec/unit/provider/package/rubygems_spec.rb +50 -44
  276. data/spec/unit/provider/package/windows/exe_spec.rb +9 -0
  277. data/spec/unit/provider/package/yum_spec.rb +61 -60
  278. data/spec/unit/provider/package_spec.rb +2 -2
  279. data/spec/unit/provider/powershell_script_spec.rb +4 -4
  280. data/spec/unit/provider/remote_directory_spec.rb +1 -1
  281. data/spec/unit/provider/remote_file/ftp_spec.rb +4 -4
  282. data/spec/unit/provider/remote_file/local_file_spec.rb +4 -2
  283. data/spec/unit/provider/remote_file/sftp_spec.rb +4 -4
  284. data/spec/unit/provider/remote_file_spec.rb +4 -4
  285. data/spec/unit/provider/script_spec.rb +4 -4
  286. data/spec/unit/provider/service/debian_service_spec.rb +4 -4
  287. data/spec/unit/provider/service/freebsd_service_spec.rb +12 -8
  288. data/spec/unit/provider/service/openbsd_service_spec.rb +12 -8
  289. data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
  290. data/spec/unit/provider/service/upstart_service_spec.rb +27 -12
  291. data/spec/unit/provider/service/windows_spec.rb +10 -10
  292. data/spec/unit/provider/systemd_unit_spec.rb +2 -2
  293. data/spec/unit/provider/template/content_spec.rb +8 -8
  294. data/spec/unit/provider/template_spec.rb +8 -8
  295. data/spec/unit/provider/user/dscl_spec.rb +51 -51
  296. data/spec/unit/provider/user/linux_spec.rb +76 -0
  297. data/spec/unit/provider/user/pw_spec.rb +3 -6
  298. data/spec/unit/provider/user/solaris_spec.rb +5 -5
  299. data/spec/unit/provider/user/windows_spec.rb +3 -3
  300. data/spec/unit/provider/user_spec.rb +2 -2
  301. data/spec/unit/provider/yum_repository_spec.rb +35 -0
  302. data/spec/unit/provider_resolver_spec.rb +306 -264
  303. data/spec/unit/recipe_spec.rb +8 -7
  304. data/spec/unit/resource/apt_repository_spec.rb +4 -4
  305. data/spec/unit/resource/apt_update_spec.rb +4 -4
  306. data/spec/unit/resource/conditional_spec.rb +46 -0
  307. data/spec/unit/resource/dsc_resource_spec.rb +8 -8
  308. data/spec/unit/resource/dsc_script_spec.rb +4 -4
  309. data/spec/unit/resource/freebsd_package_spec.rb +6 -6
  310. data/spec/unit/resource/launchd_spec.rb +3 -2
  311. data/spec/unit/resource/osx_profile_spec.rb +3 -2
  312. data/spec/unit/resource/remote_file_spec.rb +6 -6
  313. data/spec/unit/resource/service_spec.rb +14 -14
  314. data/spec/unit/resource/user_spec.rb +1 -1
  315. data/spec/unit/resource/yum_repository_spec.rb +49 -0
  316. data/spec/unit/resource_collection_spec.rb +4 -4
  317. data/spec/unit/resource_definition_spec.rb +11 -11
  318. data/spec/unit/resource_reporter_spec.rb +4 -4
  319. data/spec/unit/resource_resolver_spec.rb +6 -6
  320. data/spec/unit/resource_spec.rb +36 -16
  321. data/spec/unit/run_context/child_run_context_spec.rb +4 -4
  322. data/spec/unit/run_context/cookbook_compiler_spec.rb +43 -1
  323. data/spec/unit/run_context_spec.rb +8 -8
  324. data/spec/unit/run_list/run_list_expansion_spec.rb +2 -2
  325. data/spec/unit/runner_spec.rb +2 -2
  326. data/spec/unit/search/query_spec.rb +15 -14
  327. data/spec/unit/user_v1_spec.rb +8 -8
  328. data/spec/unit/util/dsc/configuration_generator_spec.rb +12 -12
  329. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +12 -9
  330. data/spec/unit/util/dsc/resource_store.rb +8 -6
  331. data/spec/unit/util/editor_spec.rb +6 -6
  332. data/spec/unit/util/powershell/cmdlet_spec.rb +10 -10
  333. data/tasks/bin/bundle-platform +1 -0
  334. data/tasks/bin/bundler_patch.rb +27 -0
  335. data/tasks/cbgb.rb +2 -2
  336. data/tasks/maintainers.rb +2 -2
  337. metadata +37 -8
  338. data/spec/unit/provider/user/useradd_spec.rb +0 -51
@@ -85,7 +85,7 @@ describe "Chef class" do
85
85
  end
86
86
  end
87
87
 
88
- context '#event_handler' do
88
+ context "#event_handler" do
89
89
  it "adds a new handler" do
90
90
  x = 1
91
91
  Chef.event_handler do
@@ -29,7 +29,7 @@ class TestEntry < Mash
29
29
  end
30
30
 
31
31
  describe Chef::ChefFS::DataHandler::GroupDataHandler do
32
- describe '#normalize_for_post' do
32
+ describe "#normalize_for_post" do
33
33
  let(:entry) do
34
34
  TestEntry.new("workers.json", "hive")
35
35
  end
@@ -32,7 +32,7 @@ describe "diff", :uses_diff => true do
32
32
  include FileSystemSupport
33
33
 
34
34
  context "with two filesystems with all types of difference" do
35
- let(:a) {
35
+ let(:a) do
36
36
  memory_fs("a", {
37
37
  :both_dirs => {
38
38
  :sub_both_dirs => { :subsub => nil },
@@ -58,8 +58,8 @@ describe "diff", :uses_diff => true do
58
58
  :dir_in_a_file_in_b => {},
59
59
  :file_in_a_dir_in_b => nil,
60
60
  }, /cannot_be_in_a/)
61
- }
62
- let(:b) {
61
+ end
62
+ let(:b) do
63
63
  memory_fs("b", {
64
64
  :both_dirs => {
65
65
  :sub_both_dirs => { :subsub => nil },
@@ -85,7 +85,7 @@ describe "diff", :uses_diff => true do
85
85
  :dir_in_a_file_in_b => nil,
86
86
  :file_in_a_dir_in_b => {},
87
87
  }, /cannot_be_in_b/)
88
- }
88
+ end
89
89
  it "Chef::ChefFS::CommandLine.diff_print(/)" do
90
90
  results = []
91
91
  Chef::ChefFS::CommandLine.diff_print(pattern("/"), a, b, nil, nil) do |diff|
@@ -30,17 +30,17 @@ describe Chef::ChefFS::FileSystem::OperationFailedError do
30
30
  allow(@response).to receive(:code).and_return("400")
31
31
  allow(@response).to receive(:body).and_return(response_body)
32
32
  exception = Net::HTTPServerException.new("(exception) unauthorized", @response)
33
- expect {
33
+ expect do
34
34
  raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self, exception), error_message
35
- }.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, "#{error_message} cause: #{response_body}")
35
+ end.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, "#{error_message} cause: #{response_body}")
36
36
  end
37
37
  end
38
38
 
39
39
  context "does not have a cause attribute" do
40
40
  it "does not include error cause" do
41
- expect {
41
+ expect do
42
42
  raise Chef::ChefFS::FileSystem::OperationFailedError.new(:write, self), error_message
43
- }.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, error_message)
43
+ end.to raise_error(Chef::ChefFS::FileSystem::OperationFailedError, error_message)
44
44
  end
45
45
  end
46
46
  end
@@ -55,7 +55,7 @@ describe Chef::ChefFS::FileSystem do
55
55
  end
56
56
 
57
57
  context "with a populated filesystem" do
58
- let(:fs) {
58
+ let(:fs) do
59
59
  memory_fs("", {
60
60
  :a => {
61
61
  :aa => {
@@ -69,7 +69,7 @@ describe Chef::ChefFS::FileSystem do
69
69
  :x => "",
70
70
  :y => {},
71
71
  })
72
- }
72
+ end
73
73
  context "list" do
74
74
  it "/**" do
75
75
  list_should_yield_paths(fs, "/**", "/", "/a", "/x", "/y", "/a/aa", "/a/aa/c", "/a/aa/zz", "/a/ab", "/a/ab/c")
@@ -35,9 +35,9 @@ describe Chef::ChefFS::Parallelizer do
35
35
 
36
36
  context "With :ordered => false (unordered output)" do
37
37
  it "An empty input produces an empty output" do
38
- parallelize([], :ordered => false) do
38
+ expect(parallelize([], :ordered => false) do
39
39
  sleep 10
40
- end.to_a == []
40
+ end.to_a).to eql([])
41
41
  expect(elapsed_time).to be < 0.1
42
42
  end
43
43
 
@@ -107,9 +107,9 @@ describe Chef::ChefFS::Parallelizer do
107
107
 
108
108
  context "With :ordered => true (ordered output)" do
109
109
  it "An empty input produces an empty output" do
110
- parallelize([]) do
110
+ expect(parallelize([]) do
111
111
  sleep 10
112
- end.to_a == []
112
+ end.to_a).to eql([])
113
113
  expect(elapsed_time).to be < 0.1
114
114
  end
115
115
 
@@ -211,9 +211,7 @@ describe Chef::ChefFS::Parallelizer do
211
211
  occupying_job_finished[0] = true
212
212
  end.wait
213
213
  end
214
- until started
215
- sleep(0.01)
216
- end
214
+ sleep(0.01) until started
217
215
  end
218
216
 
219
217
  after :each do
@@ -461,21 +461,21 @@ describe Chef::Cookbook::Metadata do
461
461
  expect(metadata.grouping("/db/mysql/databases/tuning", group)).to eq(group)
462
462
  end
463
463
  it "should not accept anything but a string for display_name" do
464
- expect {
464
+ expect do
465
465
  metadata.grouping("db/mysql/databases", :title => "foo")
466
- }.not_to raise_error
467
- expect {
466
+ end.not_to raise_error
467
+ expect do
468
468
  metadata.grouping("db/mysql/databases", :title => Hash.new)
469
- }.to raise_error(ArgumentError)
469
+ end.to raise_error(ArgumentError)
470
470
  end
471
471
 
472
472
  it "should not accept anything but a string for the description" do
473
- expect {
473
+ expect do
474
474
  metadata.grouping("db/mysql/databases", :description => "foo")
475
- }.not_to raise_error
476
- expect {
475
+ end.not_to raise_error
476
+ expect do
477
477
  metadata.grouping("db/mysql/databases", :description => Hash.new)
478
- }.to raise_error(ArgumentError)
478
+ end.to raise_error(ArgumentError)
479
479
  end
480
480
  end
481
481
 
@@ -498,63 +498,63 @@ describe Chef::Cookbook::Metadata do
498
498
  end
499
499
 
500
500
  it "should not accept anything but a string for display_name" do
501
- expect {
501
+ expect do
502
502
  metadata.attribute("db/mysql/databases", :display_name => "foo")
503
- }.not_to raise_error
504
- expect {
503
+ end.not_to raise_error
504
+ expect do
505
505
  metadata.attribute("db/mysql/databases", :display_name => Hash.new)
506
- }.to raise_error(ArgumentError)
506
+ end.to raise_error(ArgumentError)
507
507
  end
508
508
 
509
509
  it "should not accept anything but a string for the description" do
510
- expect {
510
+ expect do
511
511
  metadata.attribute("db/mysql/databases", :description => "foo")
512
- }.not_to raise_error
513
- expect {
512
+ end.not_to raise_error
513
+ expect do
514
514
  metadata.attribute("db/mysql/databases", :description => Hash.new)
515
- }.to raise_error(ArgumentError)
515
+ end.to raise_error(ArgumentError)
516
516
  end
517
517
 
518
518
  it "should not accept anything but a string for the source_url" do
519
- expect {
519
+ expect do
520
520
  metadata.attribute("db/mysql/databases", :source_url => "foo")
521
- }.not_to raise_error
522
- expect {
521
+ end.not_to raise_error
522
+ expect do
523
523
  metadata.attribute("db/mysql/databases", :source_url => Hash.new)
524
- }.to raise_error(ArgumentError)
524
+ end.to raise_error(ArgumentError)
525
525
  end
526
526
 
527
527
  it "should not accept anything but a string for the issues_url" do
528
- expect {
528
+ expect do
529
529
  metadata.attribute("db/mysql/databases", :issues_url => "foo")
530
- }.not_to raise_error
531
- expect {
530
+ end.not_to raise_error
531
+ expect do
532
532
  metadata.attribute("db/mysql/databases", :issues_url => Hash.new)
533
- }.to raise_error(ArgumentError)
533
+ end.to raise_error(ArgumentError)
534
534
  end
535
535
 
536
536
  it "should not accept anything but true or false for the privacy flag" do
537
- expect {
537
+ expect do
538
538
  metadata.attribute("db/mysql/databases", :privacy => true)
539
- }.not_to raise_error
540
- expect {
539
+ end.not_to raise_error
540
+ expect do
541
541
  metadata.attribute("db/mysql/databases", :privacy => false)
542
- }.not_to raise_error
543
- expect {
542
+ end.not_to raise_error
543
+ expect do
544
544
  metadata.attribute("db/mysql/databases", :privacy => "true")
545
- }.to raise_error(ArgumentError)
545
+ end.to raise_error(ArgumentError)
546
546
  end
547
547
 
548
548
  it "should not accept anything but an array of strings for choice" do
549
- expect {
549
+ expect do
550
550
  metadata.attribute("db/mysql/databases", :choice => %w{dedicated shared})
551
- }.not_to raise_error
552
- expect {
551
+ end.not_to raise_error
552
+ expect do
553
553
  metadata.attribute("db/mysql/databases", :choice => [10, "shared"])
554
- }.to raise_error(ArgumentError)
555
- expect {
554
+ end.to raise_error(ArgumentError)
555
+ expect do
556
556
  metadata.attribute("db/mysql/databases", :choice => Hash.new)
557
- }.to raise_error(ArgumentError)
557
+ end.to raise_error(ArgumentError)
558
558
  end
559
559
 
560
560
  it "should set choice to empty array by default" do
@@ -563,15 +563,15 @@ describe Chef::Cookbook::Metadata do
563
563
  end
564
564
 
565
565
  it "should let calculated be true or false" do
566
- expect {
566
+ expect do
567
567
  metadata.attribute("db/mysql/databases", :calculated => true)
568
- }.not_to raise_error
569
- expect {
568
+ end.not_to raise_error
569
+ expect do
570
570
  metadata.attribute("db/mysql/databases", :calculated => false)
571
- }.not_to raise_error
572
- expect {
571
+ end.not_to raise_error
572
+ expect do
573
573
  metadata.attribute("db/mysql/databases", :calculated => Hash.new)
574
- }.to raise_error(ArgumentError)
574
+ end.to raise_error(ArgumentError)
575
575
  end
576
576
 
577
577
  it "should set calculated to false by default" do
@@ -580,55 +580,55 @@ describe Chef::Cookbook::Metadata do
580
580
  end
581
581
 
582
582
  it "accepts String for the attribute type" do
583
- expect {
583
+ expect do
584
584
  metadata.attribute("db/mysql/databases", :type => "string")
585
- }.not_to raise_error
585
+ end.not_to raise_error
586
586
  end
587
587
 
588
588
  it "accepts Array for the attribute type" do
589
- expect {
589
+ expect do
590
590
  metadata.attribute("db/mysql/databases", :type => "array")
591
- }.not_to raise_error
592
- expect {
591
+ end.not_to raise_error
592
+ expect do
593
593
  metadata.attribute("db/mysql/databases", :type => Array.new)
594
- }.to raise_error(ArgumentError)
594
+ end.to raise_error(ArgumentError)
595
595
  end
596
596
 
597
597
  it "accepts symbol for the attribute type" do
598
- expect {
598
+ expect do
599
599
  metadata.attribute("db/mysql/databases", :type => "symbol")
600
- }.not_to raise_error
600
+ end.not_to raise_error
601
601
  end
602
602
 
603
603
  it "should let type be hash (backwards compatibility only)" do
604
- expect {
604
+ expect do
605
605
  metadata.attribute("db/mysql/databases", :type => "hash")
606
- }.not_to raise_error
606
+ end.not_to raise_error
607
607
  end
608
608
 
609
609
  it "should let required be required, recommended or optional" do
610
- expect {
610
+ expect do
611
611
  metadata.attribute("db/mysql/databases", :required => "required")
612
- }.not_to raise_error
613
- expect {
612
+ end.not_to raise_error
613
+ expect do
614
614
  metadata.attribute("db/mysql/databases", :required => "recommended")
615
- }.not_to raise_error
616
- expect {
615
+ end.not_to raise_error
616
+ expect do
617
617
  metadata.attribute("db/mysql/databases", :required => "optional")
618
- }.not_to raise_error
618
+ end.not_to raise_error
619
619
  end
620
620
 
621
621
  it "should convert required true to required" do
622
- expect {
622
+ expect do
623
623
  metadata.attribute("db/mysql/databases", :required => true)
624
- }.not_to raise_error
624
+ end.not_to raise_error
625
625
  #attrib = metadata.attributes["db/mysql/databases"][:required].should == "required"
626
626
  end
627
627
 
628
628
  it "should convert required false to optional" do
629
- expect {
629
+ expect do
630
630
  metadata.attribute("db/mysql/databases", :required => false)
631
- }.not_to raise_error
631
+ end.not_to raise_error
632
632
  #attrib = metadata.attributes["db/mysql/databases"][:required].should == "optional"
633
633
  end
634
634
 
@@ -638,12 +638,12 @@ describe Chef::Cookbook::Metadata do
638
638
  end
639
639
 
640
640
  it "should make sure recipes is an array" do
641
- expect {
641
+ expect do
642
642
  metadata.attribute("db/mysql/databases", :recipes => [])
643
- }.not_to raise_error
644
- expect {
643
+ end.not_to raise_error
644
+ expect do
645
645
  metadata.attribute("db/mysql/databases", :required => Hash.new)
646
- }.to raise_error(ArgumentError)
646
+ end.to raise_error(ArgumentError)
647
647
  end
648
648
 
649
649
  it "should set recipes to an empty array by default" do
@@ -652,24 +652,24 @@ describe Chef::Cookbook::Metadata do
652
652
  end
653
653
 
654
654
  it "should allow the default value to be a string, array, hash, boolean or numeric" do
655
- expect {
655
+ expect do
656
656
  metadata.attribute("db/mysql/databases", :default => [])
657
- }.not_to raise_error
658
- expect {
657
+ end.not_to raise_error
658
+ expect do
659
659
  metadata.attribute("db/mysql/databases", :default => {})
660
- }.not_to raise_error
661
- expect {
660
+ end.not_to raise_error
661
+ expect do
662
662
  metadata.attribute("db/mysql/databases", :default => "alice in chains")
663
- }.not_to raise_error
664
- expect {
663
+ end.not_to raise_error
664
+ expect do
665
665
  metadata.attribute("db/mysql/databases", :default => 1337)
666
- }.not_to raise_error
667
- expect {
666
+ end.not_to raise_error
667
+ expect do
668
668
  metadata.attribute("db/mysql/databases", :default => true)
669
- }.not_to raise_error
670
- expect {
669
+ end.not_to raise_error
670
+ expect do
671
671
  metadata.attribute("db/mysql/databases", :required => :not_gonna_do_it)
672
- }.to raise_error(ArgumentError)
672
+ end.to raise_error(ArgumentError)
673
673
  end
674
674
 
675
675
  it "should limit the types allowed in the choice array" do
@@ -678,87 +678,87 @@ describe Chef::Cookbook::Metadata do
678
678
  :choice => %w{test1 test2},
679
679
  :default => "test1",
680
680
  }
681
- expect {
681
+ expect do
682
682
  metadata.attribute("test_cookbook/test", options)
683
- }.not_to raise_error
683
+ end.not_to raise_error
684
684
 
685
685
  options = {
686
686
  :type => "boolean",
687
687
  :choice => [ true, false ],
688
688
  :default => true,
689
689
  }
690
- expect {
690
+ expect do
691
691
  metadata.attribute("test_cookbook/test", options)
692
- }.not_to raise_error
692
+ end.not_to raise_error
693
693
 
694
694
  options = {
695
695
  :type => "numeric",
696
696
  :choice => [ 1337, 420 ],
697
697
  :default => 1337,
698
698
  }
699
- expect {
699
+ expect do
700
700
  metadata.attribute("test_cookbook/test", options)
701
- }.not_to raise_error
701
+ end.not_to raise_error
702
702
 
703
703
  options = {
704
704
  :type => "numeric",
705
705
  :choice => [ true, "false" ],
706
706
  :default => false,
707
707
  }
708
- expect {
708
+ expect do
709
709
  metadata.attribute("test_cookbook/test", options)
710
- }.to raise_error(Chef::Exceptions::ValidationFailed)
710
+ end.to raise_error(Chef::Exceptions::ValidationFailed)
711
711
  end
712
712
 
713
713
  it "should error if default used with calculated" do
714
- expect {
714
+ expect do
715
715
  attrs = {
716
716
  :calculated => true,
717
717
  :default => [ "I thought you said calculated" ],
718
718
  }
719
719
  metadata.attribute("db/mysql/databases", attrs)
720
- }.to raise_error(ArgumentError)
721
- expect {
720
+ end.to raise_error(ArgumentError)
721
+ expect do
722
722
  attrs = {
723
723
  :calculated => true,
724
724
  :default => "I thought you said calculated",
725
725
  }
726
726
  metadata.attribute("db/mysql/databases", attrs)
727
- }.to raise_error(ArgumentError)
727
+ end.to raise_error(ArgumentError)
728
728
  end
729
729
 
730
730
  it "should allow a default that is a choice" do
731
- expect {
731
+ expect do
732
732
  attrs = {
733
733
  :choice => %w{a b c},
734
734
  :default => "b",
735
735
  }
736
736
  metadata.attribute("db/mysql/databases", attrs)
737
- }.not_to raise_error
738
- expect {
737
+ end.not_to raise_error
738
+ expect do
739
739
  attrs = {
740
740
  :choice => %w{a b c d e},
741
741
  :default => %w{b d},
742
742
  }
743
743
  metadata.attribute("db/mysql/databases", attrs)
744
- }.not_to raise_error
744
+ end.not_to raise_error
745
745
  end
746
746
 
747
747
  it "should error if default is not a choice" do
748
- expect {
748
+ expect do
749
749
  attrs = {
750
750
  :choice => %w{a b c},
751
751
  :default => "d",
752
752
  }
753
753
  metadata.attribute("db/mysql/databases", attrs)
754
- }.to raise_error(ArgumentError)
755
- expect {
754
+ end.to raise_error(ArgumentError)
755
+ expect do
756
756
  attrs = {
757
757
  :choice => %w{a b c d e},
758
758
  :default => %w{b z},
759
759
  }
760
760
  metadata.attribute("db/mysql/databases", attrs)
761
- }.to raise_error(ArgumentError)
761
+ end.to raise_error(ArgumentError)
762
762
  end
763
763
  end
764
764