chef 14.14.29-universal-mingw32 → 14.15.6-universal-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) 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/spec/data/cookbooks/openldap/metadata.rb +2 -2
  13. data/spec/data/metadata/quick_start/metadata.rb +2 -7
  14. data/spec/functional/audit/runner_spec.rb +1 -1
  15. data/spec/functional/dsl/reboot_pending_spec.rb +7 -25
  16. data/spec/functional/event_loggers/windows_eventlog_spec.rb +6 -4
  17. data/spec/functional/file_content_management/deploy_strategies_spec.rb +21 -21
  18. data/spec/functional/knife/exec_spec.rb +1 -1
  19. data/spec/functional/knife/ssh_spec.rb +3 -3
  20. data/spec/functional/mixin/user_context_spec.rb +3 -1
  21. data/spec/functional/rebooter_spec.rb +1 -1
  22. data/spec/functional/resource/aix_service_spec.rb +1 -1
  23. data/spec/functional/resource/aixinit_service_spec.rb +1 -1
  24. data/spec/functional/resource/apt_package_spec.rb +1 -1
  25. data/spec/functional/resource/chocolatey_package_spec.rb +2 -2
  26. data/spec/functional/resource/cookbook_file_spec.rb +1 -3
  27. data/spec/functional/resource/cron_spec.rb +4 -3
  28. data/spec/functional/resource/dpkg_package_spec.rb +4 -4
  29. data/spec/functional/resource/dsc_resource_spec.rb +2 -1
  30. data/spec/functional/resource/dsc_script_spec.rb +16 -20
  31. data/spec/functional/resource/execute_spec.rb +2 -2
  32. data/spec/functional/resource/git_spec.rb +6 -6
  33. data/spec/functional/resource/group_spec.rb +8 -6
  34. data/spec/functional/resource/ifconfig_spec.rb +3 -5
  35. data/spec/functional/resource/link_spec.rb +2 -2
  36. data/spec/functional/resource/mount_spec.rb +3 -7
  37. data/spec/functional/resource/powershell_script_spec.rb +9 -8
  38. data/spec/functional/resource/reboot_spec.rb +1 -1
  39. data/spec/functional/resource/remote_file_spec.rb +2 -2
  40. data/spec/functional/resource/template_spec.rb +1 -1
  41. data/spec/functional/resource/user/windows_spec.rb +2 -2
  42. data/spec/functional/resource/windows_certificate_spec.rb +3 -3
  43. data/spec/functional/resource/windows_service_spec.rb +3 -3
  44. data/spec/functional/resource/windows_task_spec.rb +51 -0
  45. data/spec/functional/run_lock_spec.rb +10 -3
  46. data/spec/functional/shell_spec.rb +1 -1
  47. data/spec/functional/util/powershell/cmdlet_spec.rb +1 -1
  48. data/spec/functional/version_spec.rb +1 -1
  49. data/spec/functional/win32/security_spec.rb +12 -7
  50. data/spec/functional/win32/service_manager_spec.rb +1 -1
  51. data/spec/functional/win32/version_info_spec.rb +4 -4
  52. data/spec/integration/client/client_spec.rb +114 -132
  53. data/spec/integration/client/exit_code_spec.rb +8 -8
  54. data/spec/integration/client/ipv6_spec.rb +5 -5
  55. data/spec/integration/knife/chef_fs_data_store_spec.rb +38 -38
  56. data/spec/integration/knife/chef_repo_path_spec.rb +42 -42
  57. data/spec/integration/knife/chef_repository_file_system_spec.rb +9 -9
  58. data/spec/integration/knife/chefignore_spec.rb +13 -13
  59. data/spec/integration/knife/client_bulk_delete_spec.rb +8 -8
  60. data/spec/integration/knife/client_create_spec.rb +1 -1
  61. data/spec/integration/knife/client_delete_spec.rb +4 -4
  62. data/spec/integration/knife/client_key_delete_spec.rb +1 -1
  63. data/spec/integration/knife/client_key_list_spec.rb +1 -1
  64. data/spec/integration/knife/client_list_spec.rb +1 -1
  65. data/spec/integration/knife/common_options_spec.rb +1 -1
  66. data/spec/integration/knife/config_get_spec.rb +1 -1
  67. data/spec/integration/knife/config_list_profiles_spec.rb +2 -1
  68. data/spec/integration/knife/cookbook_api_ipv6_spec.rb +3 -3
  69. data/spec/integration/knife/cookbook_bulk_delete_spec.rb +3 -3
  70. data/spec/integration/knife/cookbook_download_spec.rb +4 -4
  71. data/spec/integration/knife/cookbook_list_spec.rb +2 -2
  72. data/spec/integration/knife/cookbook_show_spec.rb +3 -3
  73. data/spec/integration/knife/cookbook_upload_spec.rb +6 -6
  74. data/spec/integration/knife/data_bag_delete_spec.rb +4 -4
  75. data/spec/integration/knife/data_bag_from_file_spec.rb +7 -7
  76. data/spec/integration/knife/data_bag_list_spec.rb +1 -1
  77. data/spec/integration/knife/delete_spec.rb +37 -37
  78. data/spec/integration/knife/deps_spec.rb +23 -23
  79. data/spec/integration/knife/diff_spec.rb +23 -23
  80. data/spec/integration/knife/download_spec.rb +79 -79
  81. data/spec/integration/knife/environment_compare_spec.rb +3 -3
  82. data/spec/integration/knife/environment_from_file_spec.rb +6 -6
  83. data/spec/integration/knife/environment_list_spec.rb +1 -1
  84. data/spec/integration/knife/environment_show_spec.rb +4 -4
  85. data/spec/integration/knife/list_spec.rb +25 -25
  86. data/spec/integration/knife/node_bulk_delete_spec.rb +2 -2
  87. data/spec/integration/knife/node_delete_spec.rb +2 -2
  88. data/spec/integration/knife/node_environment_set_spec.rb +1 -1
  89. data/spec/integration/knife/node_from_file_spec.rb +2 -2
  90. data/spec/integration/knife/node_list_spec.rb +1 -1
  91. data/spec/integration/knife/raw_spec.rb +12 -12
  92. data/spec/integration/knife/redirection_spec.rb +1 -1
  93. data/spec/integration/knife/role_bulk_delete_spec.rb +2 -2
  94. data/spec/integration/knife/role_delete_spec.rb +2 -2
  95. data/spec/integration/knife/role_from_file_spec.rb +5 -5
  96. data/spec/integration/knife/role_list_spec.rb +1 -1
  97. data/spec/integration/knife/role_show_spec.rb +1 -1
  98. data/spec/integration/knife/show_spec.rb +10 -10
  99. data/spec/integration/knife/upload_spec.rb +85 -85
  100. data/spec/integration/recipes/accumulator_spec.rb +4 -4
  101. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +6 -6
  102. data/spec/integration/recipes/lwrp_spec.rb +6 -6
  103. data/spec/integration/recipes/notifies_spec.rb +45 -45
  104. data/spec/integration/recipes/notifying_block_spec.rb +4 -4
  105. data/spec/integration/recipes/provider_choice.rb +1 -2
  106. data/spec/integration/recipes/recipe_dsl_spec.rb +9 -9
  107. data/spec/integration/recipes/remote_directory.rb +2 -2
  108. data/spec/integration/recipes/resource_action_spec.rb +1 -1
  109. data/spec/integration/recipes/resource_converge_if_changed_spec.rb +19 -19
  110. data/spec/integration/solo/solo_spec.rb +29 -29
  111. data/spec/scripts/ssl-serve.rb +1 -1
  112. data/spec/spec_helper.rb +11 -14
  113. data/spec/stress/win32/security_spec.rb +1 -1
  114. data/spec/support/lib/chef/resource/zen_follower.rb +1 -1
  115. data/spec/support/lib/chef/resource/zen_master.rb +1 -1
  116. data/spec/support/mock/platform.rb +2 -2
  117. data/spec/support/platform_helpers.rb +12 -3
  118. data/spec/support/platforms/win32/spec_service.rb +6 -10
  119. data/spec/support/shared/context/client.rb +2 -1
  120. data/spec/support/shared/functional/execute_resource.rb +4 -4
  121. data/spec/support/shared/functional/file_resource.rb +1 -3
  122. data/spec/support/shared/functional/http.rb +20 -44
  123. data/spec/support/shared/functional/securable_resource.rb +4 -8
  124. data/spec/support/shared/functional/win32_service.rb +1 -1
  125. data/spec/support/shared/functional/windows_script.rb +2 -1
  126. data/spec/support/shared/integration/app_server_support.rb +3 -4
  127. data/spec/support/shared/integration/integration_helper.rb +1 -0
  128. data/spec/support/shared/integration/knife_support.rb +5 -5
  129. data/spec/support/shared/unit/application_dot_d.rb +10 -4
  130. data/spec/support/shared/unit/file_system_support.rb +3 -2
  131. data/spec/support/shared/unit/platform_introspector.rb +12 -12
  132. data/spec/support/shared/unit/provider/file.rb +1 -1
  133. data/spec/support/shared/unit/script_resource.rb +1 -1
  134. data/spec/support/shared/unit/windows_script_resource.rb +1 -1
  135. data/spec/tiny_server.rb +1 -1
  136. data/spec/unit/api_client/registration_spec.rb +1 -1
  137. data/spec/unit/api_client_spec.rb +5 -5
  138. data/spec/unit/api_client_v1_spec.rb +6 -6
  139. data/spec/unit/application/client_spec.rb +8 -8
  140. data/spec/unit/application/exit_code_spec.rb +3 -2
  141. data/spec/unit/application/knife_spec.rb +1 -2
  142. data/spec/unit/audit/audit_event_proxy_spec.rb +14 -7
  143. data/spec/unit/audit/audit_reporter_spec.rb +20 -11
  144. data/spec/unit/audit/control_group_data_spec.rb +17 -12
  145. data/spec/unit/chef_fs/config_spec.rb +3 -3
  146. data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +1 -1
  147. data/spec/unit/chef_fs/parallelizer.rb +1 -1
  148. data/spec/unit/client_spec.rb +3 -3
  149. data/spec/unit/config_fetcher_spec.rb +1 -1
  150. data/spec/unit/cookbook/metadata_spec.rb +13 -13
  151. data/spec/unit/cookbook/synchronizer_spec.rb +6 -6
  152. data/spec/unit/cookbook_loader_spec.rb +17 -17
  153. data/spec/unit/cookbook_manifest_spec.rb +9 -9
  154. data/spec/unit/cookbook_site_streaming_uploader_spec.rb +1 -2
  155. data/spec/unit/cookbook_uploader_spec.rb +2 -2
  156. data/spec/unit/cookbook_version_file_specificity_spec.rb +9 -9
  157. data/spec/unit/cookbook_version_spec.rb +2 -2
  158. data/spec/unit/data_bag_item_spec.rb +7 -7
  159. data/spec/unit/data_bag_spec.rb +1 -1
  160. data/spec/unit/data_collector_spec.rb +23 -23
  161. data/spec/unit/decorator_spec.rb +2 -2
  162. data/spec/unit/deprecated_spec.rb +2 -2
  163. data/spec/unit/dsl/data_query_spec.rb +3 -2
  164. data/spec/unit/dsl/declare_resource_spec.rb +1 -1
  165. data/spec/unit/dsl/platform_introspection_spec.rb +2 -2
  166. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +2 -1
  167. data/spec/unit/encrypted_data_bag_item_spec.rb +2 -1
  168. data/spec/unit/environment_spec.rb +13 -13
  169. data/spec/unit/event_dispatch/dsl_spec.rb +1 -1
  170. data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -3
  171. data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +2 -2
  172. data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +3 -3
  173. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +1 -1
  174. data/spec/unit/http/authenticator_spec.rb +4 -3
  175. data/spec/unit/http/json_input_spec.rb +1 -1
  176. data/spec/unit/http/socketless_chef_zero_client_spec.rb +15 -15
  177. data/spec/unit/key_spec.rb +8 -8
  178. data/spec/unit/knife/bootstrap_spec.rb +14 -10
  179. data/spec/unit/knife/client_bulk_delete_spec.rb +4 -4
  180. data/spec/unit/knife/configure_client_spec.rb +1 -1
  181. data/spec/unit/knife/configure_spec.rb +1 -1
  182. data/spec/unit/knife/cookbook_bulk_delete_spec.rb +1 -1
  183. data/spec/unit/knife/cookbook_delete_spec.rb +2 -2
  184. data/spec/unit/knife/cookbook_download_spec.rb +2 -2
  185. data/spec/unit/knife/cookbook_metadata_spec.rb +4 -4
  186. data/spec/unit/knife/cookbook_upload_spec.rb +7 -5
  187. data/spec/unit/knife/core/bootstrap_context_spec.rb +1 -1
  188. data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +2 -2
  189. data/spec/unit/knife/core/gem_glob_loader_spec.rb +4 -4
  190. data/spec/unit/knife/core/hashed_command_loader_spec.rb +4 -2
  191. data/spec/unit/knife/core/node_editor_spec.rb +12 -12
  192. data/spec/unit/knife/core/ui_spec.rb +11 -11
  193. data/spec/unit/knife/data_bag_from_file_spec.rb +2 -1
  194. data/spec/unit/knife/data_bag_show_spec.rb +2 -1
  195. data/spec/unit/knife/key_create_spec.rb +1 -1
  196. data/spec/unit/knife/key_delete_spec.rb +3 -3
  197. data/spec/unit/knife/key_edit_spec.rb +4 -4
  198. data/spec/unit/knife/key_list_spec.rb +1 -1
  199. data/spec/unit/knife/key_show_spec.rb +3 -3
  200. data/spec/unit/knife/node_bulk_delete_spec.rb +3 -3
  201. data/spec/unit/knife/node_delete_spec.rb +2 -2
  202. data/spec/unit/knife/node_edit_spec.rb +1 -1
  203. data/spec/unit/knife/node_environment_set_spec.rb +1 -1
  204. data/spec/unit/knife/node_from_file_spec.rb +1 -1
  205. data/spec/unit/knife/node_policy_set_spec.rb +1 -1
  206. data/spec/unit/knife/node_run_list_add_spec.rb +1 -1
  207. data/spec/unit/knife/node_run_list_remove_spec.rb +1 -1
  208. data/spec/unit/knife/node_run_list_set_spec.rb +1 -1
  209. data/spec/unit/knife/node_show_spec.rb +1 -1
  210. data/spec/unit/knife/raw_spec.rb +2 -2
  211. data/spec/unit/knife/role_bulk_delete_spec.rb +2 -2
  212. data/spec/unit/knife/role_create_spec.rb +1 -1
  213. data/spec/unit/knife/role_delete_spec.rb +1 -1
  214. data/spec/unit/knife/role_edit_spec.rb +1 -1
  215. data/spec/unit/knife/role_env_run_list_add_spec.rb +1 -1
  216. data/spec/unit/knife/role_env_run_list_clear_spec.rb +1 -1
  217. data/spec/unit/knife/role_env_run_list_remove_spec.rb +1 -1
  218. data/spec/unit/knife/role_env_run_list_replace_spec.rb +1 -1
  219. data/spec/unit/knife/role_env_run_list_set_spec.rb +1 -1
  220. data/spec/unit/knife/role_from_file_spec.rb +1 -1
  221. data/spec/unit/knife/role_run_list_add_spec.rb +1 -1
  222. data/spec/unit/knife/role_run_list_clear_spec.rb +1 -1
  223. data/spec/unit/knife/role_run_list_remove_spec.rb +1 -1
  224. data/spec/unit/knife/role_run_list_replace_spec.rb +1 -1
  225. data/spec/unit/knife/role_run_list_set_spec.rb +1 -1
  226. data/spec/unit/knife/ssh_spec.rb +27 -17
  227. data/spec/unit/knife/ssl_check_spec.rb +4 -4
  228. data/spec/unit/knife/ssl_fetch_spec.rb +5 -5
  229. data/spec/unit/knife/status_spec.rb +3 -2
  230. data/spec/unit/knife/supermarket_download_spec.rb +4 -4
  231. data/spec/unit/knife/supermarket_install_spec.rb +5 -4
  232. data/spec/unit/knife/supermarket_share_spec.rb +1 -1
  233. data/spec/unit/knife_spec.rb +34 -33
  234. data/spec/unit/lwrp_spec.rb +19 -19
  235. data/spec/unit/mixin/homebrew_user_spec.rb +1 -1
  236. data/spec/unit/mixin/params_validate_spec.rb +10 -10
  237. data/spec/unit/mixin/properties_spec.rb +4 -4
  238. data/spec/unit/mixin/shell_out_spec.rb +27 -27
  239. data/spec/unit/mixin/template_spec.rb +4 -8
  240. data/spec/unit/mixin/unformatter_spec.rb +1 -2
  241. data/spec/unit/mixin/user_context_spec.rb +1 -2
  242. data/spec/unit/mixin/which.rb +2 -0
  243. data/spec/unit/mixin/windows_architecture_helper_spec.rb +3 -3
  244. data/spec/unit/node/attribute_spec.rb +79 -79
  245. data/spec/unit/node/immutable_collections_spec.rb +50 -50
  246. data/spec/unit/node_spec.rb +16 -16
  247. data/spec/unit/org_spec.rb +3 -3
  248. data/spec/unit/policy_builder/policyfile_spec.rb +2 -2
  249. data/spec/unit/property/state_spec.rb +26 -25
  250. data/spec/unit/property/validation_spec.rb +14 -13
  251. data/spec/unit/property_spec.rb +10 -9
  252. data/spec/unit/provider/apt_update_spec.rb +6 -6
  253. data/spec/unit/provider/cron_spec.rb +15 -15
  254. data/spec/unit/provider/dsc_resource_spec.rb +6 -3
  255. data/spec/unit/provider/dsc_script_spec.rb +1 -1
  256. data/spec/unit/provider/execute_spec.rb +5 -5
  257. data/spec/unit/provider/git_spec.rb +39 -39
  258. data/spec/unit/provider/group/dscl_spec.rb +3 -3
  259. data/spec/unit/provider/group/groupadd_spec.rb +1 -1
  260. data/spec/unit/provider/group_spec.rb +2 -3
  261. data/spec/unit/provider/ifconfig/aix_spec.rb +1 -1
  262. data/spec/unit/provider/ifconfig/debian_spec.rb +2 -2
  263. data/spec/unit/provider/ifconfig_spec.rb +45 -16
  264. data/spec/unit/provider/launchd_spec.rb +23 -15
  265. data/spec/unit/provider/link_spec.rb +22 -11
  266. data/spec/unit/provider/mount/aix_spec.rb +6 -6
  267. data/spec/unit/provider/mount/mount_spec.rb +31 -31
  268. data/spec/unit/provider/mount/solaris_spec.rb +11 -11
  269. data/spec/unit/provider/ohai_spec.rb +1 -1
  270. data/spec/unit/provider/osx_profile_spec.rb +5 -7
  271. data/spec/unit/provider/package/apt_spec.rb +5 -5
  272. data/spec/unit/provider/package/bff_spec.rb +1 -1
  273. data/spec/unit/provider/package/cab_spec.rb +1 -1
  274. data/spec/unit/provider/package/chocolatey_spec.rb +8 -8
  275. data/spec/unit/provider/package/freebsd/pkg_spec.rb +1 -1
  276. data/spec/unit/provider/package/ips_spec.rb +6 -6
  277. data/spec/unit/provider/package/macports_spec.rb +1 -1
  278. data/spec/unit/provider/package/msu_spec.rb +1 -1
  279. data/spec/unit/provider/package/openbsd_spec.rb +15 -11
  280. data/spec/unit/provider/package/pacman_spec.rb +3 -3
  281. data/spec/unit/provider/package/paludis_spec.rb +4 -4
  282. data/spec/unit/provider/package/portage_spec.rb +1 -1
  283. data/spec/unit/provider/package/powershell_spec.rb +1 -1
  284. data/spec/unit/provider/package/smartos_spec.rb +3 -3
  285. data/spec/unit/provider/package/solaris_spec.rb +1 -1
  286. data/spec/unit/provider/package/windows/exe_spec.rb +9 -9
  287. data/spec/unit/provider/package/windows/msi_spec.rb +7 -7
  288. data/spec/unit/provider/package/windows_spec.rb +2 -1
  289. data/spec/unit/provider/package/yum/yum_cache_spec.rb +1 -1
  290. data/spec/unit/provider/package/zypper_spec.rb +4 -4
  291. data/spec/unit/provider/package_spec.rb +1 -1
  292. data/spec/unit/provider/powershell_script_spec.rb +7 -7
  293. data/spec/unit/provider/registry_key_spec.rb +1 -1
  294. data/spec/unit/provider/remote_directory_spec.rb +6 -6
  295. data/spec/unit/provider/route_spec.rb +11 -11
  296. data/spec/unit/provider/service/arch_service_spec.rb +13 -13
  297. data/spec/unit/provider/service/debian_service_spec.rb +2 -1
  298. data/spec/unit/provider/service/freebsd_service_spec.rb +28 -24
  299. data/spec/unit/provider/service/gentoo_service_spec.rb +2 -2
  300. data/spec/unit/provider/service/init_service_spec.rb +11 -11
  301. data/spec/unit/provider/service/invokercd_service_spec.rb +11 -11
  302. data/spec/unit/provider/service/macosx_spec.rb +5 -5
  303. data/spec/unit/provider/service/openbsd_service_spec.rb +15 -11
  304. data/spec/unit/provider/service/simple_service_spec.rb +7 -7
  305. data/spec/unit/provider/service/upstart_service_spec.rb +14 -14
  306. data/spec/unit/provider/service/windows_spec.rb +53 -35
  307. data/spec/unit/provider/subversion_spec.rb +8 -4
  308. data/spec/unit/provider/systemd_unit_spec.rb +142 -142
  309. data/spec/unit/provider/template/content_spec.rb +29 -29
  310. data/spec/unit/provider/windows_task_spec.rb +1 -1
  311. data/spec/unit/provider_resolver_spec.rb +75 -75
  312. data/spec/unit/provider_spec.rb +2 -4
  313. data/spec/unit/recipe_spec.rb +4 -4
  314. data/spec/unit/resource/batch_spec.rb +1 -1
  315. data/spec/unit/resource/chef_gem_spec.rb +1 -1
  316. data/spec/unit/resource/chocolatey_config_spec.rb +1 -1
  317. data/spec/unit/resource/chocolatey_source_spec.rb +1 -1
  318. data/spec/unit/resource/directory_spec.rb +1 -1
  319. data/spec/unit/resource/dnf_package_spec.rb +1 -1
  320. data/spec/unit/resource/dsc_resource_spec.rb +1 -1
  321. data/spec/unit/resource/file/verification_spec.rb +1 -2
  322. data/spec/unit/resource/file_spec.rb +1 -1
  323. data/spec/unit/resource/group_spec.rb +1 -1
  324. data/spec/unit/resource/link_spec.rb +1 -1
  325. data/spec/unit/resource/osx_profile_spec.rb +2 -1
  326. data/spec/unit/resource/powershell_script_spec.rb +12 -7
  327. data/spec/unit/resource/registry_key_spec.rb +3 -3
  328. data/spec/unit/resource/rhsm_subscription_spec.rb +1 -1
  329. data/spec/unit/resource/service_spec.rb +1 -1
  330. data/spec/unit/resource/template_spec.rb +2 -2
  331. data/spec/unit/resource/windows_env_spec.rb +1 -1
  332. data/spec/unit/resource/windows_service_spec.rb +5 -5
  333. data/spec/unit/resource/windows_task_spec.rb +6 -2
  334. data/spec/unit/resource/yum_package_spec.rb +1 -1
  335. data/spec/unit/resource_collection/resource_list_spec.rb +1 -1
  336. data/spec/unit/resource_collection/resource_set_spec.rb +7 -7
  337. data/spec/unit/resource_collection/stepable_iterator_spec.rb +2 -2
  338. data/spec/unit/resource_collection_spec.rb +4 -4
  339. data/spec/unit/resource_definition_spec.rb +2 -2
  340. data/spec/unit/resource_inspector_spec.rb +1 -1
  341. data/spec/unit/resource_reporter_spec.rb +4 -4
  342. data/spec/unit/resource_spec.rb +22 -22
  343. data/spec/unit/role_spec.rb +3 -3
  344. data/spec/unit/run_context/cookbook_compiler_spec.rb +23 -23
  345. data/spec/unit/run_list/run_list_expansion_spec.rb +9 -6
  346. data/spec/unit/run_list_spec.rb +1 -1
  347. data/spec/unit/runner_spec.rb +3 -3
  348. data/spec/unit/search/query_spec.rb +3 -2
  349. data/spec/unit/shell/model_wrapper_spec.rb +1 -1
  350. data/spec/unit/shell/shell_session_spec.rb +8 -11
  351. data/spec/unit/shell_spec.rb +1 -2
  352. data/spec/unit/user_spec.rb +4 -4
  353. data/spec/unit/user_v1_spec.rb +3 -3
  354. data/spec/unit/util/backup_spec.rb +1 -1
  355. data/spec/unit/util/dsc/lcm_output_parser_spec.rb +13 -13
  356. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +3 -3
  357. data/spec/unit/util/editor_spec.rb +1 -1
  358. data/spec/unit/util/powershell/ps_credential_spec.rb +3 -2
  359. data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
  360. data/spec/unit/version_class_spec.rb +4 -4
  361. data/spec/unit/win32/registry_spec.rb +5 -5
  362. data/spec/unit/win32/security_spec.rb +2 -1
  363. data/tasks/announce.rb +4 -11
  364. metadata +10 -6
  365. data/tasks/maintainers.rb +0 -211
  366. data/tasks/templates/prerelease.md.erb +0 -35
@@ -25,7 +25,7 @@ describe Chef::Knife::RoleEdit do
25
25
  @knife.config[:print_after] = nil
26
26
  @knife.name_args = [ "adam" ]
27
27
  allow(@knife.ui).to receive(:output).and_return(true)
28
- @role = Chef::Role.new()
28
+ @role = Chef::Role.new
29
29
  allow(@role).to receive(:save)
30
30
  allow(Chef::Role).to receive(:load).and_return(@role)
31
31
  allow(@knife.ui).to receive(:edit_data).and_return(@role)
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleEnvRunListAdd do
29
29
  }
30
30
  @knife.name_args = [ "will", "QA", "role[monkey]" ]
31
31
  allow(@knife).to receive(:output).and_return(true)
32
- @role = Chef::Role.new()
32
+ @role = Chef::Role.new
33
33
  allow(@role).to receive(:save).and_return(true)
34
34
  allow(Chef::Role).to receive(:load).and_return(@role)
35
35
  end
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListClear do
33
33
  @knife.name_args = %w{will QA}
34
34
  allow(@knife).to receive(:output).and_return(true)
35
35
 
36
- @role = Chef::Role.new()
36
+ @role = Chef::Role.new
37
37
  @role.name("will")
38
38
  allow(@role).to receive(:save).and_return(true)
39
39
 
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListRemove do
33
33
  @knife.name_args = [ "will", "QA", "role[monkey]" ]
34
34
  allow(@knife).to receive(:output).and_return(true)
35
35
 
36
- @role = Chef::Role.new()
36
+ @role = Chef::Role.new
37
37
  @role.name("will")
38
38
  allow(@role).to receive(:save).and_return(true)
39
39
 
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListReplace do
33
33
  @knife.name_args = [ "will", "QA", "role[dude]", "role[person]" ]
34
34
  allow(@knife).to receive(:output).and_return(true)
35
35
 
36
- @role = Chef::Role.new()
36
+ @role = Chef::Role.new
37
37
  @role.name("will")
38
38
  allow(@role).to receive(:save).and_return(true)
39
39
 
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListSet do
33
33
  @knife.name_args = [ "will", "QA", "role[owen]", "role[mauntel]" ]
34
34
  allow(@knife).to receive(:output).and_return(true)
35
35
 
36
- @role = Chef::Role.new()
36
+ @role = Chef::Role.new
37
37
  @role.name("will")
38
38
  allow(@role).to receive(:save).and_return(true)
39
39
 
@@ -30,7 +30,7 @@ describe Chef::Knife::RoleFromFile do
30
30
  @knife.name_args = [ "adam.rb" ]
31
31
  allow(@knife).to receive(:output).and_return(true)
32
32
  allow(@knife).to receive(:confirm).and_return(true)
33
- @role = Chef::Role.new()
33
+ @role = Chef::Role.new
34
34
  allow(@role).to receive(:save)
35
35
  allow(@knife.loader).to receive(:load_from).and_return(@role)
36
36
  @stdout = StringIO.new
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleRunListAdd do
29
29
  }
30
30
  @knife.name_args = [ "will", "role[monkey]" ]
31
31
  allow(@knife).to receive(:output).and_return(true)
32
- @role = Chef::Role.new()
32
+ @role = Chef::Role.new
33
33
  allow(@role).to receive(:save).and_return(true)
34
34
  allow(Chef::Role).to receive(:load).and_return(@role)
35
35
  end
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListClear do
32
32
  @knife.name_args = [ "will" ]
33
33
  allow(@knife).to receive(:output).and_return(true)
34
34
 
35
- @role = Chef::Role.new()
35
+ @role = Chef::Role.new
36
36
  @role.name("will")
37
37
  allow(@role).to receive(:save).and_return(true)
38
38
 
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListRemove do
32
32
  @knife.name_args = [ "will", "role[monkey]" ]
33
33
  allow(@knife).to receive(:output).and_return(true)
34
34
 
35
- @role = Chef::Role.new()
35
+ @role = Chef::Role.new
36
36
  @role.name("will")
37
37
  allow(@role).to receive(:save).and_return(true)
38
38
 
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListReplace do
32
32
  @knife.name_args = [ "will", "role[dude]", "role[person]" ]
33
33
  allow(@knife).to receive(:output).and_return(true)
34
34
 
35
- @role = Chef::Role.new()
35
+ @role = Chef::Role.new
36
36
  @role.name("will")
37
37
  allow(@role).to receive(:save).and_return(true)
38
38
 
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListSet do
32
32
  @knife.name_args = [ "will", "role[owen]", "role[mauntel]" ]
33
33
  allow(@knife).to receive(:output).and_return(true)
34
34
 
35
- @role = Chef::Role.new()
35
+ @role = Chef::Role.new
36
36
  @role.name("will")
37
37
  allow(@role).to receive(:save).and_return(true)
38
38
 
@@ -360,29 +360,39 @@ describe Chef::Knife::Ssh do
360
360
  end
361
361
 
362
362
  describe "#run" do
363
- before do
364
- @query = Chef::Search::Query.new
365
- expect(@query).to receive(:search).and_yield(@node_foo)
366
- allow(Chef::Search::Query).to receive(:new).and_return(@query)
367
- allow(@knife).to receive(:ssh_command).and_return(exit_code)
368
- @knife.name_args = ["*:*", "false"]
363
+
364
+ it "should print usage and exit when a SEARCH QUERY is not provided" do
365
+ @knife.name_args = []
366
+ expect(@knife).to receive(:show_usage)
367
+ expect(@knife.ui).to receive(:fatal).with(/You must specify the SEARCH QUERY./)
368
+ expect { @knife.run }.to raise_error(SystemExit)
369
369
  end
370
370
 
371
- context "with an error" do
372
- let(:exit_code) { 1 }
371
+ context "exit" do
372
+ before do
373
+ @query = Chef::Search::Query.new
374
+ expect(@query).to receive(:search).and_yield(@node_foo)
375
+ allow(Chef::Search::Query).to receive(:new).and_return(@query)
376
+ allow(@knife).to receive(:ssh_command).and_return(exit_code)
377
+ @knife.name_args = ["*:*", "false"]
378
+ end
379
+
380
+ context "with an error" do
381
+ let(:exit_code) { 1 }
373
382
 
374
- it "should exit with a non-zero exit code" do
375
- expect(@knife).to receive(:exit).with(exit_code)
376
- @knife.run
383
+ it "should exit with a non-zero exit code" do
384
+ expect(@knife).to receive(:exit).with(exit_code)
385
+ @knife.run
386
+ end
377
387
  end
378
- end
379
388
 
380
- context "with no error" do
381
- let(:exit_code) { 0 }
389
+ context "with no error" do
390
+ let(:exit_code) { 0 }
382
391
 
383
- it "should not exit" do
384
- expect(@knife).not_to receive(:exit)
385
- @knife.run
392
+ it "should not exit" do
393
+ expect(@knife).not_to receive(:exit)
394
+ @knife.run
395
+ end
386
396
  end
387
397
  end
388
398
  end
@@ -69,10 +69,10 @@ describe Chef::Knife::SslCheck do
69
69
  expect { ssl_check.run }.to raise_error(SystemExit)
70
70
  expected_stdout = <<~E
71
71
  USAGE: knife ssl check [URL] (options)
72
- E
72
+ E
73
73
  expected_stderr = <<~E
74
74
  ERROR: Given URI: `foo.test' is invalid
75
- E
75
+ E
76
76
  expect(stdout_io.string).to eq(expected_stdout)
77
77
  expect(stderr_io.string).to eq(expected_stderr)
78
78
  end
@@ -85,10 +85,10 @@ E
85
85
  expect { ssl_check.run }.to raise_error(SystemExit)
86
86
  expected_stdout = <<~E
87
87
  USAGE: knife ssl check [URL] (options)
88
- E
88
+ E
89
89
  expected_stderr = <<~E
90
90
  ERROR: Given URI: `#{name_args[0]}' is invalid
91
- E
91
+ E
92
92
  expect(stdout_io.string).to eq(expected_stdout)
93
93
  expect(stderr_io.string).to eq(expected_stderr)
94
94
  end
@@ -70,10 +70,10 @@ describe Chef::Knife::SslFetch do
70
70
  expect { ssl_fetch.run }.to raise_error(SystemExit)
71
71
  expected_stdout = <<~E
72
72
  USAGE: knife ssl fetch [URL] (options)
73
- E
73
+ E
74
74
  expected_stderr = <<~E
75
75
  ERROR: Given URI: `foo.test' is invalid
76
- E
76
+ E
77
77
  expect(stdout_io.string).to eq(expected_stdout)
78
78
  expect(stderr_io.string).to eq(expected_stderr)
79
79
  end
@@ -86,10 +86,10 @@ E
86
86
  expect { ssl_fetch.run }.to raise_error(SystemExit)
87
87
  expected_stdout = <<~E
88
88
  USAGE: knife ssl fetch [URL] (options)
89
- E
89
+ E
90
90
  expected_stderr = <<~E
91
91
  ERROR: Given URI: `#{name_args[0]}' is invalid
92
- E
92
+ E
93
93
  expect(stdout_io.string).to eq(expected_stdout)
94
94
  expect(stderr_io.string).to eq(expected_stderr)
95
95
  end
@@ -190,7 +190,7 @@ E
190
190
  expected_error_text = <<~ERROR_TEXT
191
191
  ERROR: The service at the given URI (http://foo.example.com) does not accept SSL connections
192
192
  ERROR: Perhaps you meant to connect to 'https://foo.example.com'?
193
- ERROR_TEXT
193
+ ERROR_TEXT
194
194
 
195
195
  run
196
196
  expect(stderr).to include(expected_error_text)
@@ -30,7 +30,7 @@ describe Chef::Knife::Status do
30
30
  @query = double("Chef::Search::Query")
31
31
  allow(@query).to receive(:search).and_yield(node)
32
32
  allow(Chef::Search::Query).to receive(:new).and_return(@query)
33
- @knife = Chef::Knife::Status.new
33
+ @knife = Chef::Knife::Status.new
34
34
  @stdout = StringIO.new
35
35
  allow(@knife.ui).to receive(:stdout).and_return(@stdout)
36
36
  end
@@ -40,7 +40,8 @@ describe Chef::Knife::Status do
40
40
  { filter_result:
41
41
  { name: ["name"], ipaddress: ["ipaddress"], ohai_time: ["ohai_time"],
42
42
  ec2: ["ec2"], run_list: ["run_list"], platform: ["platform"],
43
- platform_version: ["platform_version"], chef_environment: ["chef_environment"] } } end
43
+ platform_version: ["platform_version"], chef_environment: ["chef_environment"] } }
44
+ end
44
45
 
45
46
  it "should default to searching for everything" do
46
47
  expect(@query).to receive(:search).with(:node, "*:*", opts)
@@ -31,8 +31,8 @@ describe Chef::Knife::SupermarketDownload do
31
31
  @cookbook_api_url = "https://supermarket.chef.io/api/v1/cookbooks"
32
32
  @version = "1.0.2"
33
33
  @version_us = @version.tr ".", "_"
34
- @current_data = { "deprecated" => false,
35
- "latest_version" => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
34
+ @current_data = { "deprecated" => false,
35
+ "latest_version" => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
36
36
  "replacement" => "other_apache2" }
37
37
 
38
38
  allow(@knife.ui).to receive(:stderr).and_return(@stderr)
@@ -60,7 +60,7 @@ describe Chef::Knife::SupermarketDownload do
60
60
  context "when" do
61
61
  before do
62
62
  @cookbook_data = { "version" => @version,
63
- "file" => "http://example.com/apache2_#{@version_us}.tgz" }
63
+ "file" => "http://example.com/apache2_#{@version_us}.tgz" }
64
64
  @temp_file = double( path: "/tmp/apache2_#{@version_us}.tgz" )
65
65
  @file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
66
66
  end
@@ -125,7 +125,7 @@ describe Chef::Knife::SupermarketDownload do
125
125
  @version = "1.0.1"
126
126
  @version_us = @version.tr ".", "_"
127
127
  @cookbook_data = { "version" => @version,
128
- "file" => "http://example.com/apache2_#{@version_us}.tgz" }
128
+ "file" => "http://example.com/apache2_#{@version_us}.tgz" }
129
129
  @temp_file = double(path: "/tmp/apache2_#{@version_us}.tgz")
130
130
  @file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
131
131
  @knife.name_args << @version
@@ -23,12 +23,13 @@ describe Chef::Knife::SupermarketInstall do
23
23
  let(:knife) { Chef::Knife::SupermarketInstall.new }
24
24
  let(:stdout) { StringIO.new }
25
25
  let(:stderr) { StringIO.new }
26
- let(:downloader) { Hash.new }
26
+ let(:downloader) { {} }
27
27
  let(:archive) { double(Mixlib::Archive, extract: true) }
28
28
  let(:repo) do
29
29
  double(sanity_check: true, reset_to_default_state: true,
30
30
  prepare_to_import: true, finalize_updates_to: true,
31
- merge_updates_from: true) end
31
+ merge_updates_from: true)
32
+ end
32
33
  let(:install_path) do
33
34
  if Chef::Platform.windows?
34
35
  "C:/tmp/chef"
@@ -81,7 +82,7 @@ describe Chef::Knife::SupermarketInstall do
81
82
  end
82
83
 
83
84
  it "raises an error if the second argument is not a version" do
84
- knife.name_args = ["getting-started", "1pass"]
85
+ knife.name_args = %w{getting-started 1pass}
85
86
  expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
86
87
  expect { knife.run }.to raise_error(SystemExit)
87
88
  end
@@ -93,7 +94,7 @@ describe Chef::Knife::SupermarketInstall do
93
94
  end
94
95
 
95
96
  it "raises an error if the second argument is a one-digit version" do
96
- knife.name_args = ["getting-started", "1"]
97
+ knife.name_args = %w{getting-started 1}
97
98
  expect(knife.ui).to receive(:error).with("Installing multiple cookbooks at once is not supported.")
98
99
  expect { knife.run }.to raise_error(SystemExit)
99
100
  end
@@ -175,7 +175,7 @@ describe Chef::Knife::SupermarketShare do
175
175
  response_text = Chef::JSONCompat.to_json({ uri: "https://supermarket.chef.io/cookbooks/cookbook_name" })
176
176
  allow(@upload_response).to receive(:body).and_return(response_text)
177
177
  allow(@upload_response).to receive(:code).and_return(201)
178
- expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything(), anything(), anything())
178
+ expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything, anything, anything)
179
179
  @knife.run
180
180
  end
181
181
 
@@ -35,9 +35,9 @@ describe Chef::Knife do
35
35
 
36
36
  let(:config_loader) do
37
37
  instance_double("WorkstationConfigLoader",
38
- load: nil, no_config_found?: false,
39
- config_location: config_location,
40
- chef_config_dir: "/etc/chef")
38
+ load: nil, no_config_found?: false,
39
+ config_location: config_location,
40
+ chef_config_dir: "/etc/chef")
41
41
  end
42
42
 
43
43
  before(:each) do
@@ -55,7 +55,7 @@ describe Chef::Knife do
55
55
  allow(knife.ui).to receive(:print)
56
56
  allow(Chef::Log).to receive(:init)
57
57
  allow(Chef::Log).to receive(:level)
58
- [:debug, :info, :warn, :error, :crit].each do |level_sym|
58
+ %i{debug info warn error crit}.each do |level_sym|
59
59
  allow(Chef::Log).to receive(level_sym)
60
60
  end
61
61
  allow(Chef::Knife).to receive(:puts)
@@ -166,7 +166,8 @@ describe Chef::Knife do
166
166
  "X-Chef-Version" => Chef::VERSION,
167
167
  "Host" => "api.opscode.piab",
168
168
  "X-REMOTE-REQUEST-ID" => request_id,
169
- } end
169
+ }
170
+ end
170
171
 
171
172
  let(:request_id) { "1234" }
172
173
 
@@ -205,7 +206,7 @@ describe Chef::Knife do
205
206
  KnifeSpecs.send :remove_const, :TestYourself
206
207
  end
207
208
  Kernel.load(File.join(CHEF_SPEC_DATA, "knife_subcommand", "test_yourself.rb"))
208
- Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.kind_of?(Class) }
209
+ Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.is_a?(Class) }
209
210
  end
210
211
 
211
212
  it "confirms that the headers include X-Remote-Request-Id" do
@@ -220,7 +221,7 @@ describe Chef::Knife do
220
221
  KnifeSpecs.send :remove_const, :TestYourself
221
222
  end
222
223
  Kernel.load(File.join(CHEF_SPEC_DATA, "knife_subcommand", "test_yourself.rb"))
223
- Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.kind_of?(Class) }
224
+ Chef::Knife.subcommands.each { |name, klass| Chef::Knife.subcommands.delete(name) unless klass.is_a?(Class) }
224
225
  end
225
226
 
226
227
  it "merges the global knife CLI options" do
@@ -283,8 +284,8 @@ describe Chef::Knife do
283
284
  describe "merging configuration options" do
284
285
  before do
285
286
  KnifeSpecs::TestYourself.option(:opt_with_default,
286
- short: "-D VALUE",
287
- default: "default-value")
287
+ short: "-D VALUE",
288
+ default: "default-value")
288
289
  end
289
290
 
290
291
  it "sets the default log_location to STDERR for Chef::Log warnings" do
@@ -440,8 +441,8 @@ describe Chef::Knife do
440
441
  allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("403 Forbidden", response))
441
442
  allow(knife).to receive(:username).and_return("sadpanda")
442
443
  knife.run_with_pretty_exceptions
443
- expect(stderr.string).to match(%r{ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action})
444
- expect(stderr.string).to match(%r{Response: y u no administrator})
444
+ expect(stderr.string).to match(/ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action/)
445
+ expect(stderr.string).to match(/Response: y u no administrator/)
445
446
  end
446
447
 
447
448
  context "when proxy servers are set" do
@@ -460,9 +461,9 @@ describe Chef::Knife do
460
461
  allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("403 Forbidden", response))
461
462
  allow(knife).to receive(:username).and_return("sadpanda")
462
463
  knife.run_with_pretty_exceptions
463
- expect(stderr.string).to match(%r{ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action})
464
- expect(stderr.string).to match(%r{ERROR: There are proxy servers configured, your Chef server may need to be added to NO_PROXY.})
465
- expect(stderr.string).to match(%r{Response: y u no administrator})
464
+ expect(stderr.string).to match(/ERROR: You authenticated successfully to http.+ as sadpanda but you are not authorized for this action/)
465
+ expect(stderr.string).to match(/ERROR: There are proxy servers configured, your Chef server may need to be added to NO_PROXY./)
466
+ expect(stderr.string).to match(/Response: y u no administrator/)
466
467
  end
467
468
  end
468
469
 
@@ -472,8 +473,8 @@ describe Chef::Knife do
472
473
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "y u search wrong"))
473
474
  allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("400 Bad Request", response))
474
475
  knife.run_with_pretty_exceptions
475
- expect(stderr.string).to match(%r{ERROR: The data in your request was invalid})
476
- expect(stderr.string).to match(%r{Response: y u search wrong})
476
+ expect(stderr.string).to match(/ERROR: The data in your request was invalid/)
477
+ expect(stderr.string).to match(/Response: y u search wrong/)
477
478
  end
478
479
 
479
480
  it "formats 404s nicely" do
@@ -482,8 +483,8 @@ describe Chef::Knife do
482
483
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "nothing to see here"))
483
484
  allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("404 Not Found", response))
484
485
  knife.run_with_pretty_exceptions
485
- expect(stderr.string).to match(%r{ERROR: The object you are looking for could not be found})
486
- expect(stderr.string).to match(%r{Response: nothing to see here})
486
+ expect(stderr.string).to match(/ERROR: The object you are looking for could not be found/)
487
+ expect(stderr.string).to match(/Response: nothing to see here/)
487
488
  end
488
489
 
489
490
  it "formats 406s (non-supported API version error) nicely" do
@@ -508,8 +509,8 @@ describe Chef::Knife do
508
509
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "sad trombone"))
509
510
  allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("500 Internal Server Error", response))
510
511
  knife.run_with_pretty_exceptions
511
- expect(stderr.string).to match(%r{ERROR: internal server error})
512
- expect(stderr.string).to match(%r{Response: sad trombone})
512
+ expect(stderr.string).to match(/ERROR: internal server error/)
513
+ expect(stderr.string).to match(/Response: sad trombone/)
513
514
  end
514
515
 
515
516
  it "formats 502s nicely" do
@@ -518,8 +519,8 @@ describe Chef::Knife do
518
519
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "sadder trombone"))
519
520
  allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("502 Bad Gateway", response))
520
521
  knife.run_with_pretty_exceptions
521
- expect(stderr.string).to match(%r{ERROR: bad gateway})
522
- expect(stderr.string).to match(%r{Response: sadder trombone})
522
+ expect(stderr.string).to match(/ERROR: bad gateway/)
523
+ expect(stderr.string).to match(/Response: sadder trombone/)
523
524
  end
524
525
 
525
526
  it "formats 503s nicely" do
@@ -528,8 +529,8 @@ describe Chef::Knife do
528
529
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "saddest trombone"))
529
530
  allow(knife).to receive(:run).and_raise(Net::HTTPFatalError.new("503 Service Unavailable", response))
530
531
  knife.run_with_pretty_exceptions
531
- expect(stderr.string).to match(%r{ERROR: Service temporarily unavailable})
532
- expect(stderr.string).to match(%r{Response: saddest trombone})
532
+ expect(stderr.string).to match(/ERROR: Service temporarily unavailable/)
533
+ expect(stderr.string).to match(/Response: saddest trombone/)
533
534
  end
534
535
 
535
536
  it "formats other HTTP errors nicely" do
@@ -538,16 +539,16 @@ describe Chef::Knife do
538
539
  allow(response).to receive(:body).and_return(Chef::JSONCompat.to_json(error: "nobugfixtillyoubuy"))
539
540
  allow(knife).to receive(:run).and_raise(Net::HTTPClientException.new("402 Payment Required", response))
540
541
  knife.run_with_pretty_exceptions
541
- expect(stderr.string).to match(%r{ERROR: Payment Required})
542
- expect(stderr.string).to match(%r{Response: nobugfixtillyoubuy})
542
+ expect(stderr.string).to match(/ERROR: Payment Required/)
543
+ expect(stderr.string).to match(/Response: nobugfixtillyoubuy/)
543
544
  end
544
545
 
545
546
  it "formats NameError and NoMethodError nicely" do
546
547
  allow(knife).to receive(:run).and_raise(NameError.new("Undefined constant FUUU"))
547
548
  knife.run_with_pretty_exceptions
548
- expect(stderr.string).to match(%r{ERROR: knife encountered an unexpected error})
549
- expect(stderr.string).to match(%r{This may be a bug in the 'knife' knife command or plugin})
550
- expect(stderr.string).to match(%r{Exception: NameError: Undefined constant FUUU})
549
+ expect(stderr.string).to match(/ERROR: knife encountered an unexpected error/)
550
+ expect(stderr.string).to match(/This may be a bug in the 'knife' knife command or plugin/)
551
+ expect(stderr.string).to match(/Exception: NameError: Undefined constant FUUU/)
551
552
  end
552
553
 
553
554
  it "formats missing private key errors nicely" do
@@ -555,7 +556,7 @@ describe Chef::Knife do
555
556
  allow(knife).to receive(:api_key).and_return("/home/root/.chef/no-key-here.pem")
556
557
  knife.run_with_pretty_exceptions
557
558
  expect(stderr.string).to match(%r{ERROR: Your private key could not be loaded from /home/root/.chef/no-key-here.pem})
558
- expect(stderr.string).to match(%r{Check your configuration file and ensure that your private key is readable})
559
+ expect(stderr.string).to match(/Check your configuration file and ensure that your private key is readable/)
559
560
  end
560
561
 
561
562
  it "formats connection refused errors nicely" do
@@ -564,8 +565,8 @@ describe Chef::Knife do
564
565
  # Errno::ECONNREFUSED message differs by platform
565
566
  # *nix = Errno::ECONNREFUSED: Connection refused
566
567
  # win32: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it.
567
- expect(stderr.string).to match(%r{ERROR: Network Error: .* - y u no shut up})
568
- expect(stderr.string).to match(%r{Check your knife configuration and network settings})
568
+ expect(stderr.string).to match(/ERROR: Network Error: .* - y u no shut up/)
569
+ expect(stderr.string).to match(/Check your knife configuration and network settings/)
569
570
  end
570
571
 
571
572
  it "formats SSL errors nicely and suggests to use `knife ssl check` and `knife ssl fetch`" do
@@ -579,7 +580,7 @@ describe Chef::Knife do
579
580
  Use `knife ssl check` to troubleshoot your SSL configuration.
580
581
  If your Chef Server uses a self-signed certificate, you can use
581
582
  `knife ssl fetch` to make knife trust the server's certificates.
582
- MSG
583
+ MSG
583
584
  expect(stderr.string).to include(expected_message)
584
585
  end
585
586