chef 14.14.29 → 14.15.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (367) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +18 -7
  4. data/Rakefile +7 -4
  5. data/chef.gemspec +1 -1
  6. data/lib/chef/knife/ssh.rb +6 -0
  7. data/lib/chef/provider/ifconfig.rb +14 -5
  8. data/lib/chef/provider/windows_task.rb +9 -5
  9. data/lib/chef/resource/kernel_module.rb +61 -0
  10. data/lib/chef/resource/windows_task.rb +4 -0
  11. data/lib/chef/version.rb +1 -1
  12. data/lib/chef/win32/system.rb +0 -0
  13. data/spec/data/cookbooks/openldap/metadata.rb +2 -2
  14. data/spec/data/metadata/quick_start/metadata.rb +2 -7
  15. data/spec/functional/audit/runner_spec.rb +1 -1
  16. data/spec/functional/dsl/reboot_pending_spec.rb +7 -25
  17. data/spec/functional/event_loggers/windows_eventlog_spec.rb +6 -4
  18. data/spec/functional/file_content_management/deploy_strategies_spec.rb +21 -21
  19. data/spec/functional/knife/exec_spec.rb +1 -1
  20. data/spec/functional/knife/ssh_spec.rb +3 -3
  21. data/spec/functional/mixin/user_context_spec.rb +3 -1
  22. data/spec/functional/rebooter_spec.rb +1 -1
  23. data/spec/functional/resource/aix_service_spec.rb +1 -1
  24. data/spec/functional/resource/aixinit_service_spec.rb +1 -1
  25. data/spec/functional/resource/apt_package_spec.rb +1 -1
  26. data/spec/functional/resource/chocolatey_package_spec.rb +2 -2
  27. data/spec/functional/resource/cookbook_file_spec.rb +1 -3
  28. data/spec/functional/resource/cron_spec.rb +4 -3
  29. data/spec/functional/resource/dpkg_package_spec.rb +4 -4
  30. data/spec/functional/resource/dsc_resource_spec.rb +2 -1
  31. data/spec/functional/resource/dsc_script_spec.rb +16 -20
  32. data/spec/functional/resource/execute_spec.rb +2 -2
  33. data/spec/functional/resource/git_spec.rb +6 -6
  34. data/spec/functional/resource/group_spec.rb +8 -6
  35. data/spec/functional/resource/ifconfig_spec.rb +3 -5
  36. data/spec/functional/resource/link_spec.rb +2 -2
  37. data/spec/functional/resource/mount_spec.rb +3 -7
  38. data/spec/functional/resource/powershell_script_spec.rb +9 -8
  39. data/spec/functional/resource/reboot_spec.rb +1 -1
  40. data/spec/functional/resource/remote_file_spec.rb +2 -2
  41. data/spec/functional/resource/template_spec.rb +1 -1
  42. data/spec/functional/resource/user/windows_spec.rb +2 -2
  43. data/spec/functional/resource/windows_certificate_spec.rb +3 -3
  44. data/spec/functional/resource/windows_service_spec.rb +3 -3
  45. data/spec/functional/resource/windows_task_spec.rb +51 -0
  46. data/spec/functional/run_lock_spec.rb +10 -3
  47. data/spec/functional/shell_spec.rb +1 -1
  48. data/spec/functional/util/powershell/cmdlet_spec.rb +1 -1
  49. data/spec/functional/version_spec.rb +1 -1
  50. data/spec/functional/win32/security_spec.rb +12 -7
  51. data/spec/functional/win32/service_manager_spec.rb +1 -1
  52. data/spec/functional/win32/version_info_spec.rb +4 -4
  53. data/spec/integration/client/client_spec.rb +114 -132
  54. data/spec/integration/client/exit_code_spec.rb +8 -8
  55. data/spec/integration/client/ipv6_spec.rb +5 -5
  56. data/spec/integration/knife/chef_fs_data_store_spec.rb +38 -38
  57. data/spec/integration/knife/chef_repo_path_spec.rb +42 -42
  58. data/spec/integration/knife/chef_repository_file_system_spec.rb +9 -9
  59. data/spec/integration/knife/chefignore_spec.rb +13 -13
  60. data/spec/integration/knife/client_bulk_delete_spec.rb +8 -8
  61. data/spec/integration/knife/client_create_spec.rb +1 -1
  62. data/spec/integration/knife/client_delete_spec.rb +4 -4
  63. data/spec/integration/knife/client_key_delete_spec.rb +1 -1
  64. data/spec/integration/knife/client_key_list_spec.rb +1 -1
  65. data/spec/integration/knife/client_list_spec.rb +1 -1
  66. data/spec/integration/knife/common_options_spec.rb +1 -1
  67. data/spec/integration/knife/config_get_spec.rb +1 -1
  68. data/spec/integration/knife/config_list_profiles_spec.rb +2 -1
  69. data/spec/integration/knife/cookbook_api_ipv6_spec.rb +3 -3
  70. data/spec/integration/knife/cookbook_bulk_delete_spec.rb +3 -3
  71. data/spec/integration/knife/cookbook_download_spec.rb +4 -4
  72. data/spec/integration/knife/cookbook_list_spec.rb +2 -2
  73. data/spec/integration/knife/cookbook_show_spec.rb +3 -3
  74. data/spec/integration/knife/cookbook_upload_spec.rb +6 -6
  75. data/spec/integration/knife/data_bag_delete_spec.rb +4 -4
  76. data/spec/integration/knife/data_bag_from_file_spec.rb +7 -7
  77. data/spec/integration/knife/data_bag_list_spec.rb +1 -1
  78. data/spec/integration/knife/delete_spec.rb +37 -37
  79. data/spec/integration/knife/deps_spec.rb +23 -23
  80. data/spec/integration/knife/diff_spec.rb +23 -23
  81. data/spec/integration/knife/download_spec.rb +79 -79
  82. data/spec/integration/knife/environment_compare_spec.rb +3 -3
  83. data/spec/integration/knife/environment_from_file_spec.rb +6 -6
  84. data/spec/integration/knife/environment_list_spec.rb +1 -1
  85. data/spec/integration/knife/environment_show_spec.rb +4 -4
  86. data/spec/integration/knife/list_spec.rb +25 -25
  87. data/spec/integration/knife/node_bulk_delete_spec.rb +2 -2
  88. data/spec/integration/knife/node_delete_spec.rb +2 -2
  89. data/spec/integration/knife/node_environment_set_spec.rb +1 -1
  90. data/spec/integration/knife/node_from_file_spec.rb +2 -2
  91. data/spec/integration/knife/node_list_spec.rb +1 -1
  92. data/spec/integration/knife/raw_spec.rb +12 -12
  93. data/spec/integration/knife/redirection_spec.rb +1 -1
  94. data/spec/integration/knife/role_bulk_delete_spec.rb +2 -2
  95. data/spec/integration/knife/role_delete_spec.rb +2 -2
  96. data/spec/integration/knife/role_from_file_spec.rb +5 -5
  97. data/spec/integration/knife/role_list_spec.rb +1 -1
  98. data/spec/integration/knife/role_show_spec.rb +1 -1
  99. data/spec/integration/knife/show_spec.rb +10 -10
  100. data/spec/integration/knife/upload_spec.rb +85 -85
  101. data/spec/integration/recipes/accumulator_spec.rb +4 -4
  102. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +6 -6
  103. data/spec/integration/recipes/lwrp_spec.rb +6 -6
  104. data/spec/integration/recipes/notifies_spec.rb +45 -45
  105. data/spec/integration/recipes/notifying_block_spec.rb +4 -4
  106. data/spec/integration/recipes/provider_choice.rb +1 -2
  107. data/spec/integration/recipes/recipe_dsl_spec.rb +9 -9
  108. data/spec/integration/recipes/remote_directory.rb +2 -2
  109. data/spec/integration/recipes/resource_action_spec.rb +1 -1
  110. data/spec/integration/recipes/resource_converge_if_changed_spec.rb +19 -19
  111. data/spec/integration/solo/solo_spec.rb +29 -29
  112. data/spec/scripts/ssl-serve.rb +1 -1
  113. data/spec/spec_helper.rb +11 -14
  114. data/spec/stress/win32/security_spec.rb +1 -1
  115. data/spec/support/lib/chef/resource/zen_follower.rb +1 -1
  116. data/spec/support/lib/chef/resource/zen_master.rb +1 -1
  117. data/spec/support/mock/platform.rb +2 -2
  118. data/spec/support/platform_helpers.rb +12 -3
  119. data/spec/support/platforms/win32/spec_service.rb +6 -10
  120. data/spec/support/shared/context/client.rb +2 -1
  121. data/spec/support/shared/functional/execute_resource.rb +4 -4
  122. data/spec/support/shared/functional/file_resource.rb +1 -3
  123. data/spec/support/shared/functional/http.rb +20 -44
  124. data/spec/support/shared/functional/securable_resource.rb +4 -8
  125. data/spec/support/shared/functional/win32_service.rb +1 -1
  126. data/spec/support/shared/functional/windows_script.rb +2 -1
  127. data/spec/support/shared/integration/app_server_support.rb +3 -4
  128. data/spec/support/shared/integration/integration_helper.rb +1 -0
  129. data/spec/support/shared/integration/knife_support.rb +5 -5
  130. data/spec/support/shared/unit/application_dot_d.rb +10 -4
  131. data/spec/support/shared/unit/file_system_support.rb +3 -2
  132. data/spec/support/shared/unit/platform_introspector.rb +12 -12
  133. data/spec/support/shared/unit/provider/file.rb +1 -1
  134. data/spec/support/shared/unit/script_resource.rb +1 -1
  135. data/spec/support/shared/unit/windows_script_resource.rb +1 -1
  136. data/spec/tiny_server.rb +1 -1
  137. data/spec/unit/api_client/registration_spec.rb +1 -1
  138. data/spec/unit/api_client_spec.rb +5 -5
  139. data/spec/unit/api_client_v1_spec.rb +6 -6
  140. data/spec/unit/application/client_spec.rb +8 -8
  141. data/spec/unit/application/exit_code_spec.rb +3 -2
  142. data/spec/unit/application/knife_spec.rb +1 -2
  143. data/spec/unit/audit/audit_event_proxy_spec.rb +14 -7
  144. data/spec/unit/audit/audit_reporter_spec.rb +20 -11
  145. data/spec/unit/audit/control_group_data_spec.rb +17 -12
  146. data/spec/unit/chef_fs/config_spec.rb +3 -3
  147. data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +1 -1
  148. data/spec/unit/chef_fs/parallelizer.rb +1 -1
  149. data/spec/unit/client_spec.rb +3 -3
  150. data/spec/unit/config_fetcher_spec.rb +1 -1
  151. data/spec/unit/cookbook/metadata_spec.rb +13 -13
  152. data/spec/unit/cookbook/synchronizer_spec.rb +6 -6
  153. data/spec/unit/cookbook_loader_spec.rb +17 -17
  154. data/spec/unit/cookbook_manifest_spec.rb +9 -9
  155. data/spec/unit/cookbook_site_streaming_uploader_spec.rb +1 -2
  156. data/spec/unit/cookbook_uploader_spec.rb +2 -2
  157. data/spec/unit/cookbook_version_file_specificity_spec.rb +9 -9
  158. data/spec/unit/cookbook_version_spec.rb +2 -2
  159. data/spec/unit/data_bag_item_spec.rb +7 -7
  160. data/spec/unit/data_bag_spec.rb +1 -1
  161. data/spec/unit/data_collector_spec.rb +23 -23
  162. data/spec/unit/decorator_spec.rb +2 -2
  163. data/spec/unit/deprecated_spec.rb +2 -2
  164. data/spec/unit/dsl/data_query_spec.rb +3 -2
  165. data/spec/unit/dsl/declare_resource_spec.rb +1 -1
  166. data/spec/unit/dsl/platform_introspection_spec.rb +2 -2
  167. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +2 -1
  168. data/spec/unit/encrypted_data_bag_item_spec.rb +2 -1
  169. data/spec/unit/environment_spec.rb +13 -13
  170. data/spec/unit/event_dispatch/dsl_spec.rb +1 -1
  171. data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -3
  172. data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +2 -2
  173. data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +3 -3
  174. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +1 -1
  175. data/spec/unit/http/authenticator_spec.rb +4 -3
  176. data/spec/unit/http/json_input_spec.rb +1 -1
  177. data/spec/unit/http/socketless_chef_zero_client_spec.rb +15 -15
  178. data/spec/unit/key_spec.rb +8 -8
  179. data/spec/unit/knife/bootstrap_spec.rb +14 -10
  180. data/spec/unit/knife/client_bulk_delete_spec.rb +4 -4
  181. data/spec/unit/knife/configure_client_spec.rb +1 -1
  182. data/spec/unit/knife/configure_spec.rb +1 -1
  183. data/spec/unit/knife/cookbook_bulk_delete_spec.rb +1 -1
  184. data/spec/unit/knife/cookbook_delete_spec.rb +2 -2
  185. data/spec/unit/knife/cookbook_download_spec.rb +2 -2
  186. data/spec/unit/knife/cookbook_metadata_spec.rb +4 -4
  187. data/spec/unit/knife/cookbook_upload_spec.rb +7 -5
  188. data/spec/unit/knife/core/bootstrap_context_spec.rb +1 -1
  189. data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +2 -2
  190. data/spec/unit/knife/core/gem_glob_loader_spec.rb +4 -4
  191. data/spec/unit/knife/core/hashed_command_loader_spec.rb +4 -2
  192. data/spec/unit/knife/core/node_editor_spec.rb +12 -12
  193. data/spec/unit/knife/core/ui_spec.rb +11 -11
  194. data/spec/unit/knife/data_bag_from_file_spec.rb +2 -1
  195. data/spec/unit/knife/data_bag_show_spec.rb +2 -1
  196. data/spec/unit/knife/key_create_spec.rb +1 -1
  197. data/spec/unit/knife/key_delete_spec.rb +3 -3
  198. data/spec/unit/knife/key_edit_spec.rb +4 -4
  199. data/spec/unit/knife/key_list_spec.rb +1 -1
  200. data/spec/unit/knife/key_show_spec.rb +3 -3
  201. data/spec/unit/knife/node_bulk_delete_spec.rb +3 -3
  202. data/spec/unit/knife/node_delete_spec.rb +2 -2
  203. data/spec/unit/knife/node_edit_spec.rb +1 -1
  204. data/spec/unit/knife/node_environment_set_spec.rb +1 -1
  205. data/spec/unit/knife/node_from_file_spec.rb +1 -1
  206. data/spec/unit/knife/node_policy_set_spec.rb +1 -1
  207. data/spec/unit/knife/node_run_list_add_spec.rb +1 -1
  208. data/spec/unit/knife/node_run_list_remove_spec.rb +1 -1
  209. data/spec/unit/knife/node_run_list_set_spec.rb +1 -1
  210. data/spec/unit/knife/node_show_spec.rb +1 -1
  211. data/spec/unit/knife/raw_spec.rb +2 -2
  212. data/spec/unit/knife/role_bulk_delete_spec.rb +2 -2
  213. data/spec/unit/knife/role_create_spec.rb +1 -1
  214. data/spec/unit/knife/role_delete_spec.rb +1 -1
  215. data/spec/unit/knife/role_edit_spec.rb +1 -1
  216. data/spec/unit/knife/role_env_run_list_add_spec.rb +1 -1
  217. data/spec/unit/knife/role_env_run_list_clear_spec.rb +1 -1
  218. data/spec/unit/knife/role_env_run_list_remove_spec.rb +1 -1
  219. data/spec/unit/knife/role_env_run_list_replace_spec.rb +1 -1
  220. data/spec/unit/knife/role_env_run_list_set_spec.rb +1 -1
  221. data/spec/unit/knife/role_from_file_spec.rb +1 -1
  222. data/spec/unit/knife/role_run_list_add_spec.rb +1 -1
  223. data/spec/unit/knife/role_run_list_clear_spec.rb +1 -1
  224. data/spec/unit/knife/role_run_list_remove_spec.rb +1 -1
  225. data/spec/unit/knife/role_run_list_replace_spec.rb +1 -1
  226. data/spec/unit/knife/role_run_list_set_spec.rb +1 -1
  227. data/spec/unit/knife/ssh_spec.rb +27 -17
  228. data/spec/unit/knife/ssl_check_spec.rb +4 -4
  229. data/spec/unit/knife/ssl_fetch_spec.rb +5 -5
  230. data/spec/unit/knife/status_spec.rb +3 -2
  231. data/spec/unit/knife/supermarket_download_spec.rb +4 -4
  232. data/spec/unit/knife/supermarket_install_spec.rb +5 -4
  233. data/spec/unit/knife/supermarket_share_spec.rb +1 -1
  234. data/spec/unit/knife_spec.rb +34 -33
  235. data/spec/unit/lwrp_spec.rb +19 -19
  236. data/spec/unit/mixin/homebrew_user_spec.rb +1 -1
  237. data/spec/unit/mixin/params_validate_spec.rb +10 -10
  238. data/spec/unit/mixin/properties_spec.rb +4 -4
  239. data/spec/unit/mixin/shell_out_spec.rb +27 -27
  240. data/spec/unit/mixin/template_spec.rb +4 -8
  241. data/spec/unit/mixin/unformatter_spec.rb +1 -2
  242. data/spec/unit/mixin/user_context_spec.rb +1 -2
  243. data/spec/unit/mixin/which.rb +2 -0
  244. data/spec/unit/mixin/windows_architecture_helper_spec.rb +3 -3
  245. data/spec/unit/node/attribute_spec.rb +79 -79
  246. data/spec/unit/node/immutable_collections_spec.rb +50 -50
  247. data/spec/unit/node_spec.rb +16 -16
  248. data/spec/unit/org_spec.rb +3 -3
  249. data/spec/unit/policy_builder/policyfile_spec.rb +2 -2
  250. data/spec/unit/property/state_spec.rb +26 -25
  251. data/spec/unit/property/validation_spec.rb +14 -13
  252. data/spec/unit/property_spec.rb +10 -9
  253. data/spec/unit/provider/apt_update_spec.rb +6 -6
  254. data/spec/unit/provider/cron_spec.rb +15 -15
  255. data/spec/unit/provider/dsc_resource_spec.rb +6 -3
  256. data/spec/unit/provider/dsc_script_spec.rb +1 -1
  257. data/spec/unit/provider/execute_spec.rb +5 -5
  258. data/spec/unit/provider/git_spec.rb +39 -39
  259. data/spec/unit/provider/group/dscl_spec.rb +3 -3
  260. data/spec/unit/provider/group/groupadd_spec.rb +1 -1
  261. data/spec/unit/provider/group_spec.rb +2 -3
  262. data/spec/unit/provider/ifconfig/aix_spec.rb +1 -1
  263. data/spec/unit/provider/ifconfig/debian_spec.rb +2 -2
  264. data/spec/unit/provider/ifconfig_spec.rb +45 -16
  265. data/spec/unit/provider/launchd_spec.rb +23 -15
  266. data/spec/unit/provider/link_spec.rb +22 -11
  267. data/spec/unit/provider/mount/aix_spec.rb +6 -6
  268. data/spec/unit/provider/mount/mount_spec.rb +31 -31
  269. data/spec/unit/provider/mount/solaris_spec.rb +11 -11
  270. data/spec/unit/provider/ohai_spec.rb +1 -1
  271. data/spec/unit/provider/osx_profile_spec.rb +5 -7
  272. data/spec/unit/provider/package/apt_spec.rb +5 -5
  273. data/spec/unit/provider/package/bff_spec.rb +1 -1
  274. data/spec/unit/provider/package/cab_spec.rb +1 -1
  275. data/spec/unit/provider/package/chocolatey_spec.rb +8 -8
  276. data/spec/unit/provider/package/freebsd/pkg_spec.rb +1 -1
  277. data/spec/unit/provider/package/ips_spec.rb +6 -6
  278. data/spec/unit/provider/package/macports_spec.rb +1 -1
  279. data/spec/unit/provider/package/msu_spec.rb +1 -1
  280. data/spec/unit/provider/package/openbsd_spec.rb +15 -11
  281. data/spec/unit/provider/package/pacman_spec.rb +3 -3
  282. data/spec/unit/provider/package/paludis_spec.rb +4 -4
  283. data/spec/unit/provider/package/portage_spec.rb +1 -1
  284. data/spec/unit/provider/package/powershell_spec.rb +1 -1
  285. data/spec/unit/provider/package/smartos_spec.rb +3 -3
  286. data/spec/unit/provider/package/solaris_spec.rb +1 -1
  287. data/spec/unit/provider/package/windows/exe_spec.rb +9 -9
  288. data/spec/unit/provider/package/windows/msi_spec.rb +7 -7
  289. data/spec/unit/provider/package/windows_spec.rb +2 -1
  290. data/spec/unit/provider/package/yum/yum_cache_spec.rb +1 -1
  291. data/spec/unit/provider/package/zypper_spec.rb +4 -4
  292. data/spec/unit/provider/package_spec.rb +1 -1
  293. data/spec/unit/provider/powershell_script_spec.rb +7 -7
  294. data/spec/unit/provider/registry_key_spec.rb +1 -1
  295. data/spec/unit/provider/remote_directory_spec.rb +6 -6
  296. data/spec/unit/provider/route_spec.rb +11 -11
  297. data/spec/unit/provider/service/arch_service_spec.rb +13 -13
  298. data/spec/unit/provider/service/debian_service_spec.rb +2 -1
  299. data/spec/unit/provider/service/freebsd_service_spec.rb +28 -24
  300. data/spec/unit/provider/service/gentoo_service_spec.rb +2 -2
  301. data/spec/unit/provider/service/init_service_spec.rb +11 -11
  302. data/spec/unit/provider/service/invokercd_service_spec.rb +11 -11
  303. data/spec/unit/provider/service/macosx_spec.rb +5 -5
  304. data/spec/unit/provider/service/openbsd_service_spec.rb +15 -11
  305. data/spec/unit/provider/service/simple_service_spec.rb +7 -7
  306. data/spec/unit/provider/service/upstart_service_spec.rb +14 -14
  307. data/spec/unit/provider/service/windows_spec.rb +53 -35
  308. data/spec/unit/provider/subversion_spec.rb +8 -4
  309. data/spec/unit/provider/systemd_unit_spec.rb +142 -142
  310. data/spec/unit/provider/template/content_spec.rb +29 -29
  311. data/spec/unit/provider/windows_task_spec.rb +1 -1
  312. data/spec/unit/provider_resolver_spec.rb +75 -75
  313. data/spec/unit/provider_spec.rb +2 -4
  314. data/spec/unit/recipe_spec.rb +4 -4
  315. data/spec/unit/resource/batch_spec.rb +1 -1
  316. data/spec/unit/resource/chef_gem_spec.rb +1 -1
  317. data/spec/unit/resource/chocolatey_config_spec.rb +1 -1
  318. data/spec/unit/resource/chocolatey_source_spec.rb +1 -1
  319. data/spec/unit/resource/directory_spec.rb +1 -1
  320. data/spec/unit/resource/dnf_package_spec.rb +1 -1
  321. data/spec/unit/resource/dsc_resource_spec.rb +1 -1
  322. data/spec/unit/resource/file/verification_spec.rb +1 -2
  323. data/spec/unit/resource/file_spec.rb +1 -1
  324. data/spec/unit/resource/group_spec.rb +1 -1
  325. data/spec/unit/resource/link_spec.rb +1 -1
  326. data/spec/unit/resource/osx_profile_spec.rb +2 -1
  327. data/spec/unit/resource/powershell_script_spec.rb +12 -7
  328. data/spec/unit/resource/registry_key_spec.rb +3 -3
  329. data/spec/unit/resource/rhsm_subscription_spec.rb +1 -1
  330. data/spec/unit/resource/service_spec.rb +1 -1
  331. data/spec/unit/resource/template_spec.rb +2 -2
  332. data/spec/unit/resource/windows_env_spec.rb +1 -1
  333. data/spec/unit/resource/windows_service_spec.rb +5 -5
  334. data/spec/unit/resource/windows_task_spec.rb +6 -2
  335. data/spec/unit/resource/yum_package_spec.rb +1 -1
  336. data/spec/unit/resource_collection/resource_list_spec.rb +1 -1
  337. data/spec/unit/resource_collection/resource_set_spec.rb +7 -7
  338. data/spec/unit/resource_collection/stepable_iterator_spec.rb +2 -2
  339. data/spec/unit/resource_collection_spec.rb +4 -4
  340. data/spec/unit/resource_definition_spec.rb +2 -2
  341. data/spec/unit/resource_inspector_spec.rb +1 -1
  342. data/spec/unit/resource_reporter_spec.rb +4 -4
  343. data/spec/unit/resource_spec.rb +22 -22
  344. data/spec/unit/role_spec.rb +3 -3
  345. data/spec/unit/run_context/cookbook_compiler_spec.rb +23 -23
  346. data/spec/unit/run_list/run_list_expansion_spec.rb +9 -6
  347. data/spec/unit/run_list_spec.rb +1 -1
  348. data/spec/unit/runner_spec.rb +3 -3
  349. data/spec/unit/search/query_spec.rb +3 -2
  350. data/spec/unit/shell/model_wrapper_spec.rb +1 -1
  351. data/spec/unit/shell/shell_session_spec.rb +8 -11
  352. data/spec/unit/shell_spec.rb +1 -2
  353. data/spec/unit/user_spec.rb +4 -4
  354. data/spec/unit/user_v1_spec.rb +3 -3
  355. data/spec/unit/util/backup_spec.rb +1 -1
  356. data/spec/unit/util/dsc/lcm_output_parser_spec.rb +13 -13
  357. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +3 -3
  358. data/spec/unit/util/editor_spec.rb +1 -1
  359. data/spec/unit/util/powershell/ps_credential_spec.rb +3 -2
  360. data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
  361. data/spec/unit/version_class_spec.rb +4 -4
  362. data/spec/unit/win32/registry_spec.rb +5 -5
  363. data/spec/unit/win32/security_spec.rb +2 -1
  364. data/tasks/announce.rb +4 -11
  365. metadata +10 -6
  366. data/tasks/maintainers.rb +0 -211
  367. data/tasks/templates/prerelease.md.erb +0 -35
@@ -43,7 +43,7 @@ describe "Chef::Application::WindowsServiceManager", :windows_only, :system_wind
43
43
  end
44
44
 
45
45
  it "throws an error with required missing options" do
46
- [:service_name, :service_display_name, :service_description, :service_file_path].each do |key|
46
+ %i{service_name service_display_name service_description service_file_path}.each do |key|
47
47
  service_def = test_service.dup
48
48
  service_def.delete(key)
49
49
 
@@ -32,12 +32,12 @@ describe "Chef::ReservedNames::Win32::File::VersionInfo", :windows_only do
32
32
 
33
33
  subject { Chef::ReservedNames::Win32::File::VersionInfo.new(file_path) }
34
34
 
35
- it "file version has the same version as windows" do
36
- expect(subject.FileVersion).to start_with(os_version)
35
+ it "file version has the same major.minor version as windows" do
36
+ expect(subject.FileVersion).to start_with(os_version.rpartition(".").first)
37
37
  end
38
38
 
39
- it "product version has the same version as windows" do
40
- expect(subject.ProductVersion).to start_with(os_version)
39
+ it "product version has the same major.minor version as windows" do
40
+ expect(subject.ProductVersion).to start_with(os_version.rpartition(".").first)
41
41
  end
42
42
 
43
43
  it "company is microsoft" do
@@ -20,9 +20,7 @@ describe "chef-client" do
20
20
  # just a normal file
21
21
  # (expected_content should be uncompressed)
22
22
  @api.get("/recipes.tgz", 200) do
23
- File.open(recipes_filename, "rb") do |f|
24
- f.read
25
- end
23
+ File.open(recipes_filename, "rb", &:read)
26
24
  end
27
25
  end
28
26
 
@@ -56,35 +54,19 @@ describe "chef-client" do
56
54
  it "should complete with success" do
57
55
  file "config/client.rb", <<~EOM
58
56
  local_mode true
59
- cookbook_path "#{path_to('cookbooks')}"
60
- EOM
61
-
62
- shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
63
- end
64
-
65
- it "should complete successfully with no other environment variables", skip: (Chef::Platform.windows?) do
66
- file "config/client.rb", <<~EOM
67
- local_mode true
68
- cookbook_path "#{path_to('cookbooks')}"
69
- EOM
57
+ cookbook_path "#{path_to("cookbooks")}"
58
+ EOM
70
59
 
71
- begin
72
- result = shell_out("env -i #{critical_env_vars} #{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
73
- result.error!
74
- rescue
75
- Chef::Log.info "Bare invocation will have the following load-path."
76
- Chef::Log.info shell_out!("env -i #{critical_env_vars} ruby -e 'puts $:'").stdout
77
- raise
78
- end
60
+ shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
79
61
  end
80
62
 
81
63
  it "should complete successfully with --no-listen" do
82
64
  file "config/client.rb", <<~EOM
83
65
  local_mode true
84
- cookbook_path "#{path_to('cookbooks')}"
85
- EOM
66
+ cookbook_path "#{path_to("cookbooks")}"
67
+ EOM
86
68
 
87
- result = shell_out("#{chef_client} --no-listen -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
69
+ result = shell_out("#{chef_client} --no-listen -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
88
70
  result.error!
89
71
  end
90
72
 
@@ -125,10 +107,10 @@ EOM
125
107
  it "should complete with success" do
126
108
  file "config/client.rb", <<~EOM
127
109
  local_mode true
128
- cookbook_path "#{path_to('cookbooks')}"
129
- EOM
110
+ cookbook_path "#{path_to("cookbooks")}"
111
+ EOM
130
112
 
131
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
113
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
132
114
  result.error!
133
115
  end
134
116
 
@@ -162,40 +144,40 @@ EOM
162
144
  syHLXYFNy0OxMtH/bBAXBGNHd9gf5uOnqh0pYcbe/uRAxumC7Rl0cL509eURiA2T
163
145
  +vFmf54y9YdnLXaqv+FhJT6B6V7WX7IpU9BMqJY1cJYXHuHG2KA=
164
146
  -----END RSA PRIVATE KEY-----
165
- EOM
147
+ EOM
166
148
  end
167
149
 
168
150
  it "should complete with success even with a client key" do
169
151
  file "config/client.rb", <<~EOM
170
152
  local_mode true
171
- client_key #{path_to('mykey.pem').inspect}
172
- cookbook_path #{path_to('cookbooks').inspect}
173
- EOM
153
+ client_key #{path_to("mykey.pem").inspect}
154
+ cookbook_path #{path_to("cookbooks").inspect}
155
+ EOM
174
156
 
175
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
157
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
176
158
  result.error!
177
159
  end
178
160
 
179
161
  it "should run recipes specified directly on the command line" do
180
162
  file "config/client.rb", <<~EOM
181
163
  local_mode true
182
- client_key #{path_to('mykey.pem').inspect}
183
- cookbook_path #{path_to('cookbooks').inspect}
184
- EOM
164
+ client_key #{path_to("mykey.pem").inspect}
165
+ cookbook_path #{path_to("cookbooks").inspect}
166
+ EOM
185
167
 
186
168
  file "arbitrary.rb", <<~EOM
187
- file #{path_to('tempfile.txt').inspect} do
169
+ file #{path_to("tempfile.txt").inspect} do
188
170
  content '1'
189
171
  end
190
- EOM
172
+ EOM
191
173
 
192
174
  file "arbitrary2.rb", <<~EOM
193
- file #{path_to('tempfile2.txt').inspect} do
175
+ file #{path_to("tempfile2.txt").inspect} do
194
176
  content '2'
195
177
  end
196
- EOM
178
+ EOM
197
179
 
198
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" #{path_to('arbitrary.rb')} #{path_to('arbitrary2.rb')}", cwd: chef_dir)
180
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" #{path_to("arbitrary.rb")} #{path_to("arbitrary2.rb")}", cwd: chef_dir)
199
181
  result.error!
200
182
 
201
183
  expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -205,17 +187,17 @@ EOM
205
187
  it "should run recipes specified as relative paths directly on the command line" do
206
188
  file "config/client.rb", <<~EOM
207
189
  local_mode true
208
- client_key #{path_to('mykey.pem').inspect}
209
- cookbook_path #{path_to('cookbooks').inspect}
210
- EOM
190
+ client_key #{path_to("mykey.pem").inspect}
191
+ cookbook_path #{path_to("cookbooks").inspect}
192
+ EOM
211
193
 
212
194
  file "arbitrary.rb", <<~EOM
213
- file #{path_to('tempfile.txt').inspect} do
195
+ file #{path_to("tempfile.txt").inspect} do
214
196
  content '1'
215
197
  end
216
- EOM
198
+ EOM
217
199
 
218
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" arbitrary.rb", cwd: path_to(""))
200
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" arbitrary.rb", cwd: path_to(""))
219
201
  result.error!
220
202
 
221
203
  expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -224,22 +206,22 @@ EOM
224
206
  it "should run recipes specified directly on the command line AFTER recipes in the run list" do
225
207
  file "config/client.rb", <<~EOM
226
208
  local_mode true
227
- client_key #{path_to('mykey.pem').inspect}
228
- cookbook_path #{path_to('cookbooks').inspect}
229
- EOM
209
+ client_key #{path_to("mykey.pem").inspect}
210
+ cookbook_path #{path_to("cookbooks").inspect}
211
+ EOM
230
212
 
231
213
  file "cookbooks/x/recipes/constant_definition.rb", <<~EOM
232
214
  class ::Blah
233
215
  THECONSTANT = '1'
234
216
  end
235
- EOM
217
+ EOM
236
218
  file "arbitrary.rb", <<~EOM
237
- file #{path_to('tempfile.txt').inspect} do
219
+ file #{path_to("tempfile.txt").inspect} do
238
220
  content ::Blah::THECONSTANT
239
221
  end
240
- EOM
222
+ EOM
241
223
 
242
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o x::constant_definition arbitrary.rb", cwd: path_to(""))
224
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o x::constant_definition arbitrary.rb", cwd: path_to(""))
243
225
  result.error!
244
226
 
245
227
  expect(IO.read(path_to("tempfile.txt"))).to eq("1")
@@ -250,30 +232,30 @@ EOM
250
232
  it "should complete with success when passed the -z flag" do
251
233
  file "config/client.rb", <<~EOM
252
234
  chef_server_url 'http://omg.com/blah'
253
- cookbook_path "#{path_to('cookbooks')}"
254
- EOM
235
+ cookbook_path "#{path_to("cookbooks")}"
236
+ EOM
255
237
 
256
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
238
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
257
239
  result.error!
258
240
  end
259
241
 
260
242
  it "should complete with success when passed the --local-mode flag" do
261
243
  file "config/client.rb", <<~EOM
262
244
  chef_server_url 'http://omg.com/blah'
263
- cookbook_path "#{path_to('cookbooks')}"
264
- EOM
245
+ cookbook_path "#{path_to("cookbooks")}"
246
+ EOM
265
247
 
266
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir)
248
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --local-mode", cwd: chef_dir)
267
249
  result.error!
268
250
  end
269
251
 
270
252
  it "should not print SSL warnings when running in local-mode" do
271
253
  file "config/client.rb", <<~EOM
272
254
  chef_server_url 'http://omg.com/blah'
273
- cookbook_path "#{path_to('cookbooks')}"
274
- EOM
255
+ cookbook_path "#{path_to("cookbooks")}"
256
+ EOM
275
257
 
276
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --local-mode", cwd: chef_dir)
258
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --local-mode", cwd: chef_dir)
277
259
  expect(result.stdout).not_to include("SSL validation of HTTPS requests is disabled.")
278
260
  result.error!
279
261
  end
@@ -281,20 +263,20 @@ EOM
281
263
  it "should complete with success when passed -z and --chef-zero-port" do
282
264
  file "config/client.rb", <<~EOM
283
265
  chef_server_url 'http://omg.com/blah'
284
- cookbook_path "#{path_to('cookbooks')}"
285
- EOM
266
+ cookbook_path "#{path_to("cookbooks")}"
267
+ EOM
286
268
 
287
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
269
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
288
270
  result.error!
289
271
  end
290
272
 
291
273
  it "should complete with success when setting the run list with -r" do
292
274
  file "config/client.rb", <<~EOM
293
275
  chef_server_url 'http://omg.com/blah'
294
- cookbook_path "#{path_to('cookbooks')}"
295
- EOM
276
+ cookbook_path "#{path_to("cookbooks")}"
277
+ EOM
296
278
 
297
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -r 'x::default' -z -l info", cwd: chef_dir)
279
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -r 'x::default' -z -l info", cwd: chef_dir)
298
280
  expect(result.stdout).not_to include("Overridden Run List")
299
281
  expect(result.stdout).to include("Run List is [recipe[x::default]]")
300
282
  result.error!
@@ -303,9 +285,9 @@ EOM
303
285
  it "should complete with success when using --profile-ruby and output a profile file", :not_supported_on_aix do
304
286
  file "config/client.rb", <<~EOM
305
287
  local_mode true
306
- cookbook_path "#{path_to('cookbooks')}"
307
- EOM
308
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", cwd: chef_dir)
288
+ cookbook_path "#{path_to("cookbooks")}"
289
+ EOM
290
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z --profile-ruby", cwd: chef_dir)
309
291
  result.error!
310
292
  expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be true
311
293
  end
@@ -313,9 +295,9 @@ EOM
313
295
  it "doesn't produce a profile when --profile-ruby is not present" do
314
296
  file "config/client.rb", <<~EOM
315
297
  local_mode true
316
- cookbook_path "#{path_to('cookbooks')}"
317
- EOM
318
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", cwd: chef_dir)
298
+ cookbook_path "#{path_to("cookbooks")}"
299
+ EOM
300
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' -z", cwd: chef_dir)
319
301
  result.error!
320
302
  expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be false
321
303
  end
@@ -328,14 +310,14 @@ EOM
328
310
  name 'x'
329
311
  version '0.0.1'
330
312
  chef_version '~> 999.99'
331
- EOM
313
+ EOM
332
314
  file "config/client.rb", <<~EOM
333
315
  local_mode true
334
- cookbook_path "#{path_to('cookbooks')}"
335
- EOM
316
+ cookbook_path "#{path_to("cookbooks")}"
317
+ EOM
336
318
  end
337
319
  it "should fail the chef client run" do
338
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
320
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
339
321
  expect(command.exitstatus).to eql(1)
340
322
  expect(command.stdout).to match(/Chef::Exceptions::CookbookChefVersionMismatch/)
341
323
  end
@@ -356,12 +338,12 @@ EOM
356
338
  EOM
357
339
  file "config/client.rb", <<-EOM
358
340
  local_mode true
359
- cookbook_path "#{path_to('cookbooks')}"
341
+ cookbook_path "#{path_to("cookbooks")}"
360
342
  EOM
361
343
  end
362
344
 
363
345
  it "the cheffish DSL is loaded lazily" do
364
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
346
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
365
347
  expect(command.exitstatus).to eql(0)
366
348
  end
367
349
  end
@@ -373,16 +355,16 @@ EOM
373
355
  EOM
374
356
  file "config/client.rb", <<-EOM
375
357
  local_mode true
376
- cookbook_path "#{path_to('cookbooks')}"
358
+ cookbook_path "#{path_to("cookbooks")}"
377
359
  EOM
378
360
  end
379
361
 
380
362
  it "the cheffish DSL tries to load but fails (because chef-provisioning is not there)" do
381
363
  # we'd need to have a custom bundle to fix this that omitted chef-provisioning, but that would dig our crazy even deeper, so lets not
382
364
  skip "but if chef-provisioning is in our bundle or in our gemset then this test, very annoyingly, always fails"
383
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
365
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
384
366
  expect(command.exitstatus).to eql(1)
385
- expect(command.stdout).to match(/cannot load such file -- chef\/provisioning/)
367
+ expect(command.stdout).to match(%r{cannot load such file -- chef/provisioning})
386
368
  end
387
369
  end
388
370
 
@@ -407,15 +389,15 @@ EOM
407
389
  it "should output each deprecation warning only once, at the end of the run" do
408
390
  file "config/client.rb", <<~EOM
409
391
  local_mode true
410
- cookbook_path "#{path_to('cookbooks')}"
392
+ cookbook_path "#{path_to("cookbooks")}"
411
393
  # Mimick what happens when you are on the console
412
394
  formatters << :doc
413
395
  log_level :warn
414
- EOM
396
+ EOM
415
397
 
416
398
  ENV.delete("CHEF_TREAT_DEPRECATION_WARNINGS_AS_ERRORS")
417
399
 
418
- result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
400
+ result = shell_out!("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
419
401
  expect(result.error?).to be_falsey
420
402
 
421
403
  # Search to the end of the client run in the output
@@ -432,10 +414,10 @@ EOM
432
414
  before do
433
415
  file "config/client.rb", <<~EOM
434
416
  local_mode true
435
- cookbook_path "#{path_to('cookbooks')}"
417
+ cookbook_path "#{path_to("cookbooks")}"
436
418
  audit_mode :enabled
437
419
  silence_deprecation_warnings %w{chef-27}
438
- EOM
420
+ EOM
439
421
  end
440
422
 
441
423
  it "should exit with a zero code when there is not an audit failure" do
@@ -447,7 +429,7 @@ EOM
447
429
  end
448
430
  RECIPE
449
431
 
450
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::succeed' -l info", cwd: chef_dir)
432
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'audit_test::succeed' -l info", cwd: chef_dir)
451
433
  expect(result.error?).to be_falsey
452
434
  expect(result.stdout).to include("Successfully executed all `control_group` blocks and contained examples")
453
435
  end
@@ -461,7 +443,7 @@ EOM
461
443
  end
462
444
  RECIPE
463
445
 
464
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'audit_test::fail'", cwd: chef_dir)
446
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'audit_test::fail'", cwd: chef_dir)
465
447
  expect(result.error?).to be_truthy
466
448
  expect(result.stdout).to include("Failure/Error: expect(2 - 2).to eq(1)")
467
449
  end
@@ -470,7 +452,7 @@ EOM
470
452
  when_the_repository "has a cookbook that deploys a file" do
471
453
  before do
472
454
  file "cookbooks/x/recipes/default.rb", <<~RECIPE
473
- cookbook_file #{path_to('tempfile.txt').inspect} do
455
+ cookbook_file #{path_to("tempfile.txt").inspect} do
474
456
  source "my_file"
475
457
  end
476
458
  RECIPE
@@ -486,9 +468,9 @@ EOM
486
468
  file "config/client.rb", <<~EOM
487
469
  no_lazy_load #{lazy}
488
470
  local_mode true
489
- cookbook_path "#{path_to('cookbooks')}"
490
- EOM
491
- result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
471
+ cookbook_path "#{path_to("cookbooks")}"
472
+ EOM
473
+ result = shell_out("#{chef_client} -l debug -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
492
474
  result.error!
493
475
 
494
476
  expect(IO.read(path_to("tempfile.txt")).strip).to eq("this is my file")
@@ -500,7 +482,7 @@ EOM
500
482
  when_the_repository "has a cookbook with an ohai plugin" do
501
483
  before do
502
484
  file "cookbooks/x/recipes/default.rb", <<~RECIPE
503
- file #{path_to('tempfile.txt').inspect} do
485
+ file #{path_to("tempfile.txt").inspect} do
504
486
  content node["english"]["version"]
505
487
  end
506
488
  RECIPE
@@ -518,12 +500,12 @@ EOM
518
500
 
519
501
  file "config/client.rb", <<~EOM
520
502
  local_mode true
521
- cookbook_path "#{path_to('cookbooks')}"
522
- EOM
503
+ cookbook_path "#{path_to("cookbooks")}"
504
+ EOM
523
505
  end
524
506
 
525
507
  it "should run the ohai plugin" do
526
- result = shell_out("#{chef_client} -l debug -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
508
+ result = shell_out("#{chef_client} -l debug -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
527
509
  result.error!
528
510
 
529
511
  expect(IO.read(path_to("tempfile.txt"))).to eq("2014")
@@ -545,8 +527,8 @@ EOM
545
527
  it "should complete with success when passed -z and --recipe-url" do
546
528
  file "config/client.rb", <<~EOM
547
529
  chef_repo_path "#{tmp_dir}"
548
- EOM
549
- result = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", cwd: tmp_dir)
530
+ EOM
531
+ result = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" --recipe-url=http://localhost:9000/recipes.tgz -o 'x::default' -z", cwd: tmp_dir)
550
532
  result.error!
551
533
  end
552
534
 
@@ -569,27 +551,27 @@ EOM
569
551
  name 'x'
570
552
  version '0.0.1'
571
553
  raise "TEH SADNESS"
572
- EOM
554
+ EOM
573
555
  file "cookbooks/x/metadata.json", <<~EOM
574
556
  {
575
557
  "name": "x",
576
558
  "version": "0.0.1"
577
559
  }
578
- EOM
560
+ EOM
579
561
 
580
562
  file "config/client.rb", <<~EOM
581
563
  local_mode true
582
- cookbook_path "#{path_to('cookbooks')}"
583
- EOM
564
+ cookbook_path "#{path_to("cookbooks")}"
565
+ EOM
584
566
  end
585
567
 
586
568
  it "the chef client run should succeed" do
587
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
569
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
588
570
  command.error!
589
571
  end
590
572
 
591
573
  it "a chef-solo run should succeed" do
592
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
574
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
593
575
  command.error!
594
576
  end
595
577
  end
@@ -603,30 +585,30 @@ EOM
603
585
  EOM
604
586
  file "config/client.rb", <<~EOM
605
587
  local_mode true
606
- cookbook_path "#{path_to('cookbooks')}"
607
- EOM
588
+ cookbook_path "#{path_to("cookbooks")}"
589
+ EOM
608
590
  end
609
591
 
610
592
  it "a chef client run should not log to info by default" do
611
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
593
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
612
594
  command.error!
613
595
  expect(command.stdout).not_to include("INFO")
614
596
  end
615
597
 
616
598
  it "a chef client run to a pipe should not log to info by default" do
617
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir)
599
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork | tee #{path_to("chefrun.out")}", cwd: chef_dir)
618
600
  command.error!
619
601
  expect(command.stdout).not_to include("INFO")
620
602
  end
621
603
 
622
604
  it "a chef solo run should not log to info by default" do
623
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
605
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
624
606
  command.error!
625
607
  expect(command.stdout).not_to include("INFO")
626
608
  end
627
609
 
628
610
  it "a chef solo run to a pipe should not log to info by default" do
629
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork | tee #{path_to('chefrun.out')}", cwd: chef_dir)
611
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork | tee #{path_to("chefrun.out")}", cwd: chef_dir)
630
612
  command.error!
631
613
  expect(command.stdout).not_to include("INFO")
632
614
  end
@@ -636,45 +618,45 @@ EOM
636
618
  before do
637
619
  file "cookbooks/x/recipes/default.rb", <<~EOM
638
620
  puts Chef::Config[:client_fork] ? "WITHFORK" : "NOFORK"
639
- EOM
621
+ EOM
640
622
  file "config/client.rb", <<~EOM
641
623
  local_mode true
642
- cookbook_path "#{path_to('cookbooks')}"
643
- EOM
624
+ cookbook_path "#{path_to("cookbooks")}"
625
+ EOM
644
626
  end
645
627
 
646
628
  it "chef-client runs by default with no supervisor" do
647
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
629
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
648
630
  command.error!
649
631
  expect(command.stdout).to include("NOFORK")
650
632
  end
651
633
 
652
634
  it "chef-solo runs by default with no supervisor" do
653
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
635
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
654
636
  command.error!
655
637
  expect(command.stdout).to include("NOFORK")
656
638
  end
657
639
 
658
640
  it "chef-client --no-fork does not fork" do
659
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
641
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
660
642
  command.error!
661
643
  expect(command.stdout).to include("NOFORK")
662
644
  end
663
645
 
664
646
  it "chef-solo --no-fork does not fork" do
665
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --no-fork", cwd: chef_dir)
647
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --no-fork", cwd: chef_dir)
666
648
  command.error!
667
649
  expect(command.stdout).to include("NOFORK")
668
650
  end
669
651
 
670
652
  it "chef-client with --fork uses a supervisor" do
671
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir)
653
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --fork", cwd: chef_dir)
672
654
  command.error!
673
655
  expect(command.stdout).to include("WITHFORK")
674
656
  end
675
657
 
676
658
  it "chef-solo with --fork uses a supervisor" do
677
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default' --fork", cwd: chef_dir)
659
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default' --fork", cwd: chef_dir)
678
660
  command.error!
679
661
  expect(command.stdout).to include("WITHFORK")
680
662
  end
@@ -684,22 +666,22 @@ EOM
684
666
  before do
685
667
  file "cookbooks/x/recipes/default.rb", <<~EOM
686
668
  puts Chef::Config[:client_fork] ? "WITHFORK" : "NOFORK"
687
- EOM
669
+ EOM
688
670
  file "config/client.rb", <<~EOM
689
671
  local_mode true
690
- cookbook_path "#{path_to('cookbooks')}"
672
+ cookbook_path "#{path_to("cookbooks")}"
691
673
  client_fork true
692
- EOM
674
+ EOM
693
675
  end
694
676
 
695
677
  it "chef-client uses a supervisor" do
696
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
678
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
697
679
  command.error!
698
680
  expect(command.stdout).to include("WITHFORK")
699
681
  end
700
682
 
701
683
  it "chef-solo uses a supervisor" do
702
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
684
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
703
685
  command.error!
704
686
  expect(command.stdout).to include("WITHFORK")
705
687
  end
@@ -709,22 +691,22 @@ EOM
709
691
  before do
710
692
  file "cookbooks/x/recipes/default.rb", <<~EOM
711
693
  puts Chef::Config[:client_fork] ? "WITHFORK" : "NOFORK"
712
- EOM
694
+ EOM
713
695
  file "config/client.rb", <<~EOM
714
696
  local_mode true
715
- cookbook_path "#{path_to('cookbooks')}"
697
+ cookbook_path "#{path_to("cookbooks")}"
716
698
  client_fork false
717
- EOM
699
+ EOM
718
700
  end
719
701
 
720
702
  it "chef-client uses a supervisor" do
721
- command = shell_out("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
703
+ command = shell_out("#{chef_client} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
722
704
  command.error!
723
705
  expect(command.stdout).to include("NOFORK")
724
706
  end
725
707
 
726
708
  it "chef-solo uses a supervisor" do
727
- command = shell_out("#{chef_solo} -c \"#{path_to('config/client.rb')}\" -o 'x::default'", cwd: chef_dir)
709
+ command = shell_out("#{chef_solo} -c \"#{path_to("config/client.rb")}\" -o 'x::default'", cwd: chef_dir)
728
710
  command.error!
729
711
  expect(command.stdout).to include("NOFORK")
730
712
  end