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

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -41,8 +41,7 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
41
41
  tag_id: 0,
42
42
  dependencies: ["Winmgmt"],
43
43
  service_start_name: "LocalSystem",
44
- display_name: "Chef Client Service"
45
- )
44
+ display_name: "Chef Client Service")
46
45
  end
47
46
 
48
47
  # Actual response from Win32::Service.services
@@ -73,8 +72,7 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
73
72
  command: nil,
74
73
  num_actions: 0,
75
74
  actions: nil,
76
- delayed_start: 1
77
- )
75
+ delayed_start: 1)
78
76
  end
79
77
 
80
78
  let(:provider) do
@@ -98,7 +96,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
98
96
 
99
97
  allow(Win32::Service).to receive(:start).with(any_args).and_return(Win32::Service)
100
98
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
101
- double("StatusStruct", current_state: "running"))
99
+ double("StatusStruct", current_state: "running")
100
+ )
102
101
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name)
103
102
  .and_return(chef_service_config_info)
104
103
 
@@ -176,8 +175,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
176
175
  tag_id: 0,
177
176
  dependencies: %w{NSI Tdx Afd},
178
177
  service_start_name: 'NT Authority\\LocalService',
179
- display_name: "DHCP Client"
180
- ))
178
+ display_name: "DHCP Client")
179
+ )
181
180
  end
182
181
 
183
182
  context "startup_type is neither :automatic or :disabled" do
@@ -192,8 +191,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
192
191
  tag_id: 0,
193
192
  dependencies: %w{NSI Tdx Afd},
194
193
  service_start_name: 'NT Authority\\LocalService',
195
- display_name: "DHCP Client"
196
- ))
194
+ display_name: "DHCP Client")
195
+ )
197
196
  end
198
197
 
199
198
  it "does not set the current resources enabled" do
@@ -385,14 +384,14 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
385
384
  # properties that are Strings
386
385
  %i{binary_path_name load_order_group dependencies run_as_user
387
386
  display_name description}.each do |attr|
388
- it "configures service if #{attr} has changed" do
389
- provider.current_resource.send("#{attr}=", "old value")
390
- provider.new_resource.send("#{attr}=", "new value")
387
+ it "configures service if #{attr} has changed" do
388
+ provider.current_resource.send("#{attr}=", "old value")
389
+ provider.new_resource.send("#{attr}=", "new value")
391
390
 
392
- expect(Win32::Service).to receive(:configure)
393
- provider.action_configure
394
- end
395
- end
391
+ expect(Win32::Service).to receive(:configure)
392
+ provider.action_configure
393
+ end
394
+ end
396
395
 
397
396
  # properties that are Integers
398
397
  %i{service_type error_control}.each do |attr|
@@ -503,7 +502,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
503
502
  before(:each) do
504
503
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
505
504
  double("StatusStruct", current_state: "stopped"),
506
- double("StatusStruct", current_state: "running"))
505
+ double("StatusStruct", current_state: "running")
506
+ )
507
507
  end
508
508
 
509
509
  context "run_as_user user is specified" do
@@ -553,7 +553,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
553
553
 
554
554
  it "does nothing if the service is running" do
555
555
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
556
- double("StatusStruct", current_state: "running"))
556
+ double("StatusStruct", current_state: "running")
557
+ )
557
558
  provider.load_current_resource
558
559
  expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
559
560
  provider.start_service
@@ -562,7 +563,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
562
563
 
563
564
  it "raises an error if the service is paused" do
564
565
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
565
- double("StatusStruct", current_state: "paused"))
566
+ double("StatusStruct", current_state: "paused")
567
+ )
566
568
  provider.load_current_resource
567
569
  expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
568
570
  expect { provider.start_service }.to raise_error( Chef::Exceptions::Service )
@@ -573,7 +575,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
573
575
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
574
576
  double("StatusStruct", current_state: "start pending"),
575
577
  double("StatusStruct", current_state: "start pending"),
576
- double("StatusStruct", current_state: "running"))
578
+ double("StatusStruct", current_state: "running")
579
+ )
577
580
  provider.load_current_resource
578
581
  expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
579
582
  provider.start_service
@@ -582,7 +585,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
582
585
 
583
586
  it "fails if the service is in stop_pending" do
584
587
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
585
- double("StatusStruct", current_state: "stop pending"))
588
+ double("StatusStruct", current_state: "stop pending")
589
+ )
586
590
  provider.load_current_resource
587
591
  expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
588
592
  expect { provider.start_service }.to raise_error( Chef::Exceptions::Service )
@@ -623,7 +627,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
623
627
  before(:each) do
624
628
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
625
629
  double("StatusStruct", current_state: "running"),
626
- double("StatusStruct", current_state: "stopped"))
630
+ double("StatusStruct", current_state: "stopped")
631
+ )
627
632
  end
628
633
 
629
634
  it "calls the stop command if one is specified" do
@@ -648,7 +653,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
648
653
 
649
654
  it "does nothing if the service is stopped" do
650
655
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
651
- double("StatusStruct", current_state: "stopped"))
656
+ double("StatusStruct", current_state: "stopped")
657
+ )
652
658
  provider.load_current_resource
653
659
  expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
654
660
  provider.stop_service
@@ -657,7 +663,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
657
663
 
658
664
  it "raises an error if the service is paused" do
659
665
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
660
- double("StatusStruct", current_state: "paused"))
666
+ double("StatusStruct", current_state: "paused")
667
+ )
661
668
  provider.load_current_resource
662
669
  expect(Win32::Service).not_to receive(:start).with(new_resource.service_name)
663
670
  expect { provider.stop_service }.to raise_error( Chef::Exceptions::Service )
@@ -668,7 +675,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
668
675
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
669
676
  double("StatusStruct", current_state: "stop pending"),
670
677
  double("StatusStruct", current_state: "stop pending"),
671
- double("StatusStruct", current_state: "stopped"))
678
+ double("StatusStruct", current_state: "stopped")
679
+ )
672
680
  provider.load_current_resource
673
681
  expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
674
682
  provider.stop_service
@@ -677,7 +685,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
677
685
 
678
686
  it "fails if the service is in start_pending" do
679
687
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
680
- double("StatusStruct", current_state: "start pending"))
688
+ double("StatusStruct", current_state: "start pending")
689
+ )
681
690
  provider.load_current_resource
682
691
  expect(Win32::Service).not_to receive(:stop).with(new_resource.service_name)
683
692
  expect { provider.stop_service }.to raise_error( Chef::Exceptions::Service )
@@ -686,7 +695,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
686
695
 
687
696
  it "passes custom timeout to the stop command if provided" do
688
697
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
689
- double("StatusStruct", current_state: "running"))
698
+ double("StatusStruct", current_state: "running")
699
+ )
690
700
  new_resource.timeout 1
691
701
  expect(Win32::Service).to receive(:stop).with(new_resource.service_name)
692
702
  Timeout.timeout(2) do
@@ -711,7 +721,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
711
721
  double("StatusStruct", current_state: "running"),
712
722
  double("StatusStruct", current_state: "stopped"),
713
723
  double("StatusStruct", current_state: "stopped"),
714
- double("StatusStruct", current_state: "running"))
724
+ double("StatusStruct", current_state: "running")
725
+ )
715
726
  expect(Win32::Service).to receive(:stop).with(new_resource.service_name)
716
727
  expect(Win32::Service).to receive(:start).with(new_resource.service_name)
717
728
  provider.restart_service
@@ -722,7 +733,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
722
733
  allow(Win32::Service).to receive(:status).with(new_resource.service_name).and_return(
723
734
  double("StatusStruct", current_state: "stopped"),
724
735
  double("StatusStruct", current_state: "stopped"),
725
- double("StatusStruct", current_state: "running"))
736
+ double("StatusStruct", current_state: "running")
737
+ )
726
738
  expect(Win32::Service).to receive(:start).with(new_resource.service_name)
727
739
  provider.restart_service
728
740
  expect(new_resource.updated_by_last_action?).to be_truthy
@@ -741,7 +753,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
741
753
  describe Chef::Provider::Service::Windows, "enable_service" do
742
754
  before(:each) do
743
755
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
744
- double("ConfigStruct", start_type: "disabled"))
756
+ double("ConfigStruct", start_type: "disabled")
757
+ )
745
758
  end
746
759
 
747
760
  it "enables service" do
@@ -761,14 +774,16 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
761
774
  describe Chef::Provider::Service::Windows, "action_enable" do
762
775
  it "does nothing if the service is enabled" do
763
776
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
764
- double("ConfigStruct", start_type: "auto start"))
777
+ double("ConfigStruct", start_type: "auto start")
778
+ )
765
779
  expect(provider).not_to receive(:enable_service)
766
780
  provider.action_enable
767
781
  end
768
782
 
769
783
  it "enables the service if it is not set to automatic start" do
770
784
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
771
- double("ConfigStruct", start_type: "disabled"))
785
+ double("ConfigStruct", start_type: "disabled")
786
+ )
772
787
  expect(provider).to receive(:enable_service)
773
788
  provider.action_enable
774
789
  end
@@ -777,14 +792,16 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
777
792
  describe Chef::Provider::Service::Windows, "action_disable" do
778
793
  it "does nothing if the service is disabled" do
779
794
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
780
- double("ConfigStruct", start_type: "disabled"))
795
+ double("ConfigStruct", start_type: "disabled")
796
+ )
781
797
  expect(provider).not_to receive(:disable_service)
782
798
  provider.action_disable
783
799
  end
784
800
 
785
801
  it "disables the service if it is not set to disabled" do
786
802
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
787
- double("ConfigStruct", start_type: "auto start"))
803
+ double("ConfigStruct", start_type: "auto start")
804
+ )
788
805
  expect(provider).to receive(:disable_service)
789
806
  provider.action_disable
790
807
  end
@@ -793,7 +810,8 @@ describe Chef::Provider::Service::Windows, "load_current_resource", :windows_onl
793
810
  describe Chef::Provider::Service::Windows, "disable_service" do
794
811
  before(:each) do
795
812
  allow(Win32::Service).to receive(:config_info).with(new_resource.service_name).and_return(
796
- double("ConfigStruct", start_type: "auto start"))
813
+ double("ConfigStruct", start_type: "auto start")
814
+ )
797
815
  end
798
816
 
799
817
  it "disables service" do
@@ -277,7 +277,8 @@ describe Chef::Provider::Subversion do
277
277
  allow(ChefConfig).to receive(:windows?) { false }
278
278
  expect(@provider).to receive(:svn_binary).and_return("svn")
279
279
  expect(@provider.export_command).to eql(
280
- "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
280
+ "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
281
+ )
281
282
  end
282
283
 
283
284
  it "selects an svn binary with an exe extension on windows" do
@@ -285,21 +286,24 @@ describe Chef::Provider::Subversion do
285
286
  allow(ChefConfig).to receive(:windows?) { true }
286
287
  expect(@provider).to receive(:svn_binary).and_return("svn.exe")
287
288
  expect(@provider.export_command).to eql(
288
- "svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
289
+ "svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
290
+ )
289
291
  end
290
292
 
291
293
  it "uses a custom svn binary as part of the svn command" do
292
294
  @resource.svn_binary "teapot"
293
295
  expect(@provider).to receive(:svn_binary).and_return("teapot")
294
296
  expect(@provider.export_command).to eql(
295
- "teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
297
+ "teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
298
+ )
296
299
  end
297
300
 
298
301
  it "wraps custom svn binary with quotes if it contains whitespace" do
299
302
  @resource.svn_binary "c:/program files (x86)/subversion/svn.exe"
300
303
  expect(@provider).to receive(:svn_binary).and_return("c:/program files (x86)/subversion/svn.exe")
301
304
  expect(@provider.export_command).to eql(
302
- '"c:/program files (x86)/subversion/svn.exe" export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir')
305
+ '"c:/program files (x86)/subversion/svn.exe" export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir'
306
+ )
303
307
  end
304
308
 
305
309
  end
@@ -83,8 +83,8 @@ describe Chef::Provider::SystemdUnit do
83
83
  before(:each) do
84
84
  allow(Etc).to receive(:getpwnam).and_return(OpenStruct.new(uid: 1000))
85
85
  allow(Chef::Resource::SystemdUnit).to receive(:new)
86
- .with(unit_name)
87
- .and_return(current_resource)
86
+ .with(unit_name)
87
+ .and_return(current_resource)
88
88
  end
89
89
 
90
90
  describe "define_resource_requirements" do
@@ -121,8 +121,8 @@ describe Chef::Provider::SystemdUnit do
121
121
 
122
122
  it "should create a current resource with the name of the new resource" do
123
123
  expect(Chef::Resource::SystemdUnit).to receive(:new)
124
- .with(unit_name)
125
- .and_return(current_resource)
124
+ .with(unit_name)
125
+ .and_return(current_resource)
126
126
  provider.load_current_resource
127
127
  end
128
128
 
@@ -196,26 +196,26 @@ describe Chef::Provider::SystemdUnit do
196
196
 
197
197
  it "loads the system unit content if the file exists and user is not set" do
198
198
  allow(File).to receive(:exist?)
199
- .with(unit_path_system)
200
- .and_return(true)
199
+ .with(unit_path_system)
200
+ .and_return(true)
201
201
  allow(File).to receive(:read)
202
- .with(unit_path_system)
203
- .and_return(unit_content_string)
202
+ .with(unit_path_system)
203
+ .and_return(unit_content_string)
204
204
 
205
205
  expect(File).to receive(:exist?)
206
- .with(unit_path_system)
206
+ .with(unit_path_system)
207
207
  expect(File).to receive(:read)
208
- .with(unit_path_system)
208
+ .with(unit_path_system)
209
209
  provider.load_current_resource
210
210
  expect(current_resource.content).to eq(unit_content_string)
211
211
  end
212
212
 
213
213
  it "does not load the system unit content if the unit file is not present and the user is not set" do
214
214
  allow(File).to receive(:exist?)
215
- .with(unit_path_system)
216
- .and_return(false)
215
+ .with(unit_path_system)
216
+ .and_return(false)
217
217
  expect(File).to_not receive(:read)
218
- .with(unit_path_system)
218
+ .with(unit_path_system)
219
219
  provider.load_current_resource
220
220
  expect(current_resource.content).to eq(nil)
221
221
  end
@@ -223,15 +223,15 @@ describe Chef::Provider::SystemdUnit do
223
223
  it "loads the user unit content if the file exists and user is set" do
224
224
  new_resource.user("joe")
225
225
  allow(File).to receive(:exist?)
226
- .with(unit_path_user)
227
- .and_return(true)
226
+ .with(unit_path_user)
227
+ .and_return(true)
228
228
  allow(File).to receive(:read)
229
- .with(unit_path_user)
230
- .and_return(unit_content_string)
229
+ .with(unit_path_user)
230
+ .and_return(unit_content_string)
231
231
  expect(File).to receive(:exist?)
232
- .with(unit_path_user)
232
+ .with(unit_path_user)
233
233
  expect(File).to receive(:read)
234
- .with(unit_path_user)
234
+ .with(unit_path_user)
235
235
  provider.load_current_resource
236
236
  expect(current_resource.content).to eq(unit_content_string)
237
237
  end
@@ -239,10 +239,10 @@ describe Chef::Provider::SystemdUnit do
239
239
  it "does not load the user unit if the file does not exist and user is set" do
240
240
  new_resource.user("joe")
241
241
  allow(File).to receive(:exist?)
242
- .with(unit_path_user)
243
- .and_return(false)
242
+ .with(unit_path_user)
243
+ .and_return(false)
244
244
  expect(File).to_not receive(:read)
245
- .with(unit_path_user)
245
+ .with(unit_path_user)
246
246
  provider.load_current_resource
247
247
  expect(current_resource.content).to eq(nil)
248
248
  end
@@ -253,27 +253,27 @@ describe Chef::Provider::SystemdUnit do
253
253
  before(:each) do
254
254
  provider.current_resource = current_resource
255
255
  allow(provider).to receive(:which)
256
- .with("systemctl")
257
- .and_return(systemctl_path)
256
+ .with("systemctl")
257
+ .and_return(systemctl_path)
258
258
  end
259
259
 
260
260
  describe "creates/deletes/presets/reverts the unit" do
261
261
  it "creates the unit file when it does not exist" do
262
262
  allow(provider).to receive(:manage_unit_file)
263
- .with(:create)
264
- .and_return(true)
263
+ .with(:create)
264
+ .and_return(true)
265
265
  allow(provider).to receive(:daemon_reload)
266
- .and_return(true)
266
+ .and_return(true)
267
267
  expect(provider).to receive(:manage_unit_file).with(:create)
268
268
  provider.action_create
269
269
  end
270
270
 
271
271
  it "creates the file when the unit content is different" do
272
272
  allow(provider).to receive(:manage_unit_file)
273
- .with(:create)
274
- .and_return(true)
273
+ .with(:create)
274
+ .and_return(true)
275
275
  allow(provider).to receive(:daemon_reload)
276
- .and_return(true)
276
+ .and_return(true)
277
277
  expect(provider).to receive(:manage_unit_file).with(:create)
278
278
  provider.action_create
279
279
  end
@@ -282,7 +282,7 @@ describe Chef::Provider::SystemdUnit do
282
282
  current_resource.content(unit_content_string)
283
283
  allow(provider).to receive(:manage_unit_file).with(:create)
284
284
  allow(provider).to receive(:daemon_reload)
285
- .and_return(true)
285
+ .and_return(true)
286
286
  expect(provider).to_not receive(:manage_unit_file)
287
287
  provider.action_create
288
288
  end
@@ -294,20 +294,20 @@ describe Chef::Provider::SystemdUnit do
294
294
  expect(new_resource.triggers_reload).to eq true
295
295
  allow(provider).to receive(:shell_out_compacted!)
296
296
  expect(provider).to receive(:shell_out_compacted!)
297
- .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
297
+ .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
298
298
  provider.action_create
299
299
  end
300
300
 
301
301
  it "triggers a daemon-reload when deleting a unit with triggers_reload" do
302
302
  new_resource.user("joe")
303
303
  allow(File).to receive(:exist?)
304
- .with(unit_path_user)
305
- .and_return(true)
304
+ .with(unit_path_user)
305
+ .and_return(true)
306
306
  allow(provider).to receive(:manage_unit_file).with(:delete)
307
307
  expect(new_resource.triggers_reload).to eq true
308
308
  allow(provider).to receive(:shell_out_compacted!)
309
309
  expect(provider).to receive(:shell_out_compacted!)
310
- .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
310
+ .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
311
311
  provider.action_delete
312
312
  end
313
313
 
@@ -317,7 +317,7 @@ describe Chef::Provider::SystemdUnit do
317
317
  allow(provider).to receive(:manage_unit_file).with(:create)
318
318
  allow(provider).to receive(:shell_out_compacted!)
319
319
  expect(provider).to_not receive(:shell_out_compacted!)
320
- .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
320
+ .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
321
321
  provider.action_create
322
322
  end
323
323
 
@@ -325,23 +325,23 @@ describe Chef::Provider::SystemdUnit do
325
325
  new_resource.user("joe")
326
326
  new_resource.triggers_reload(false)
327
327
  allow(File).to receive(:exist?)
328
- .with(unit_path_user)
329
- .and_return(true)
328
+ .with(unit_path_user)
329
+ .and_return(true)
330
330
  allow(provider).to receive(:manage_unit_file).with(:delete)
331
331
  allow(provider).to receive(:shell_out_compacted!)
332
332
  expect(provider).to_not receive(:shell_out_compacted!)
333
- .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
333
+ .with(systemctl_path, "--user", "daemon-reload", **user_cmd_opts, default_env: false)
334
334
  provider.action_delete
335
335
  end
336
336
 
337
337
  it "deletes the file when it exists" do
338
338
  new_resource.user("joe")
339
339
  allow(File).to receive(:exist?)
340
- .with(unit_path_user)
341
- .and_return(true)
340
+ .with(unit_path_user)
341
+ .and_return(true)
342
342
  allow(provider).to receive(:manage_unit_file)
343
- .with(:delete)
344
- .and_return(true)
343
+ .with(:delete)
344
+ .and_return(true)
345
345
  allow(provider).to receive(:daemon_reload)
346
346
  expect(provider).to receive(:manage_unit_file).with(:delete)
347
347
  provider.action_delete
@@ -350,8 +350,8 @@ describe Chef::Provider::SystemdUnit do
350
350
  it "does not delete the file when it is absent" do
351
351
  new_resource.user("joe")
352
352
  allow(File).to receive(:exist?)
353
- .with(unit_path_user)
354
- .and_return(false)
353
+ .with(unit_path_user)
354
+ .and_return(false)
355
355
  allow(provider).to receive(:manage_unit_file).with(:delete)
356
356
  expect(provider).to_not receive(:manage_unit_file)
357
357
  provider.action_delete
@@ -360,16 +360,16 @@ describe Chef::Provider::SystemdUnit do
360
360
  it "presets the unit" do
361
361
  new_resource.user("joe")
362
362
  expect(provider).to receive(:shell_out_compacted!)
363
- .with(systemctl_path, "--user", "preset", unit_name, **user_cmd_opts)
364
- .and_return(shell_out_success)
363
+ .with(systemctl_path, "--user", "preset", unit_name, **user_cmd_opts)
364
+ .and_return(shell_out_success)
365
365
  provider.action_preset
366
366
  end
367
367
 
368
368
  it "reverts the unit" do
369
369
  new_resource.user("joe")
370
370
  expect(provider).to receive(:shell_out_compacted!)
371
- .with(systemctl_path, "--user", "revert", unit_name, **user_cmd_opts)
372
- .and_return(shell_out_success)
371
+ .with(systemctl_path, "--user", "revert", unit_name, **user_cmd_opts)
372
+ .and_return(shell_out_success)
373
373
  provider.action_revert
374
374
  end
375
375
  end
@@ -380,19 +380,19 @@ describe Chef::Provider::SystemdUnit do
380
380
  expect(new_resource.triggers_reload).to eq true
381
381
  allow(provider).to receive(:shell_out_compacted!)
382
382
  expect(provider).to receive(:shell_out_compacted!)
383
- .with(systemctl_path, "--system", "daemon-reload", default_env: false)
383
+ .with(systemctl_path, "--system", "daemon-reload", default_env: false)
384
384
  provider.action_create
385
385
  end
386
386
 
387
387
  it "triggers a daemon-reload when deleting a unit with triggers_reload" do
388
388
  allow(File).to receive(:exist?)
389
- .with(unit_path_system)
390
- .and_return(true)
389
+ .with(unit_path_system)
390
+ .and_return(true)
391
391
  allow(provider).to receive(:manage_unit_file).with(:delete)
392
392
  expect(new_resource.triggers_reload).to eq true
393
393
  allow(provider).to receive(:shell_out_compacted!)
394
394
  expect(provider).to receive(:shell_out_compacted!)
395
- .with(systemctl_path, "--system", "daemon-reload", default_env: false)
395
+ .with(systemctl_path, "--system", "daemon-reload", default_env: false)
396
396
  provider.action_delete
397
397
  end
398
398
 
@@ -401,27 +401,27 @@ describe Chef::Provider::SystemdUnit do
401
401
  allow(provider).to receive(:manage_unit_file).with(:create)
402
402
  allow(provider).to receive(:shell_out_compacted!)
403
403
  expect(provider).to_not receive(:shell_out_compacted!)
404
- .with(systemctl_path, "--system", "daemon-reload", default_env: false)
404
+ .with(systemctl_path, "--system", "daemon-reload", default_env: false)
405
405
  provider.action_create
406
406
  end
407
407
 
408
408
  it "does not trigger a daemon-reload when deleting a unit without triggers_reload" do
409
409
  new_resource.triggers_reload(false)
410
410
  allow(File).to receive(:exist?)
411
- .with(unit_path_system)
412
- .and_return(true)
411
+ .with(unit_path_system)
412
+ .and_return(true)
413
413
  allow(provider).to receive(:manage_unit_file).with(:delete)
414
414
  allow(provider).to receive(:shell_out_compacted!)
415
415
  expect(provider).to_not receive(:shell_out_compacted!)
416
- .with(systemctl_path, "--system", "daemon-reload", default_env: false)
416
+ .with(systemctl_path, "--system", "daemon-reload", default_env: false)
417
417
  provider.action_delete
418
418
  end
419
419
  it "deletes the file when it exists" do
420
420
  allow(File).to receive(:exist?)
421
- .with(unit_path_system)
422
- .and_return(true)
421
+ .with(unit_path_system)
422
+ .and_return(true)
423
423
  allow(provider).to receive(:manage_unit_file)
424
- .with(:delete)
424
+ .with(:delete)
425
425
  allow(provider).to receive(:daemon_reload)
426
426
  expect(provider).to receive(:manage_unit_file).with(:delete)
427
427
  provider.action_delete
@@ -429,8 +429,8 @@ describe Chef::Provider::SystemdUnit do
429
429
 
430
430
  it "does not delete the file when it is absent" do
431
431
  allow(File).to receive(:exist?)
432
- .with(unit_path_system)
433
- .and_return(false)
432
+ .with(unit_path_system)
433
+ .and_return(false)
434
434
  allow(provider).to receive(:manage_unit_file).with(:delete)
435
435
  allow(provider).to receive(:daemon_reload)
436
436
  expect(provider).to_not receive(:manage_unit_file)
@@ -439,15 +439,15 @@ describe Chef::Provider::SystemdUnit do
439
439
 
440
440
  it "presets the unit" do
441
441
  expect(provider).to receive(:shell_out_compacted!)
442
- .with(systemctl_path, "--system", "preset", unit_name)
443
- .and_return(shell_out_success)
442
+ .with(systemctl_path, "--system", "preset", unit_name)
443
+ .and_return(shell_out_success)
444
444
  provider.action_preset
445
445
  end
446
446
 
447
447
  it "reverts the unit" do
448
448
  expect(provider).to receive(:shell_out_compacted!)
449
- .with(systemctl_path, "--system", "revert", unit_name)
450
- .and_return(shell_out_success)
449
+ .with(systemctl_path, "--system", "revert", unit_name)
450
+ .and_return(shell_out_success)
451
451
  provider.action_revert
452
452
  end
453
453
  end
@@ -458,8 +458,8 @@ describe Chef::Provider::SystemdUnit do
458
458
  it "reenables the unit" do
459
459
  current_resource.user(user_name)
460
460
  expect(provider).to receive(:shell_out_compacted!)
461
- .with(systemctl_path, "--user", "reenable", unit_name, **user_cmd_opts)
462
- .and_return(shell_out_success)
461
+ .with(systemctl_path, "--user", "reenable", unit_name, **user_cmd_opts)
462
+ .and_return(shell_out_success)
463
463
  provider.action_reenable
464
464
  end
465
465
 
@@ -467,8 +467,8 @@ describe Chef::Provider::SystemdUnit do
467
467
  current_resource.user(user_name)
468
468
  current_resource.enabled(false)
469
469
  expect(provider).to receive(:shell_out_compacted!)
470
- .with(systemctl_path, "--user", "enable", unit_name, **user_cmd_opts)
471
- .and_return(shell_out_success)
470
+ .with(systemctl_path, "--user", "enable", unit_name, **user_cmd_opts)
471
+ .and_return(shell_out_success)
472
472
  provider.action_enable
473
473
  end
474
474
 
@@ -490,8 +490,8 @@ describe Chef::Provider::SystemdUnit do
490
490
  current_resource.user(user_name)
491
491
  current_resource.enabled(true)
492
492
  expect(provider).to receive(:shell_out_compacted!)
493
- .with(systemctl_path, "--user", "disable", unit_name, **user_cmd_opts)
494
- .and_return(shell_out_success)
493
+ .with(systemctl_path, "--user", "disable", unit_name, **user_cmd_opts)
494
+ .and_return(shell_out_success)
495
495
  provider.action_disable
496
496
  end
497
497
 
@@ -513,16 +513,16 @@ describe Chef::Provider::SystemdUnit do
513
513
  context "when no user is specified" do
514
514
  it "reenables the unit" do
515
515
  expect(provider).to receive(:shell_out_compacted!)
516
- .with(systemctl_path, "--system", "reenable", unit_name)
517
- .and_return(shell_out_success)
516
+ .with(systemctl_path, "--system", "reenable", unit_name)
517
+ .and_return(shell_out_success)
518
518
  provider.action_reenable
519
519
  end
520
520
 
521
521
  it "enables the unit when it is disabled" do
522
522
  current_resource.enabled(false)
523
523
  expect(provider).to receive(:shell_out_compacted!)
524
- .with(systemctl_path, "--system", "enable", unit_name)
525
- .and_return(shell_out_success)
524
+ .with(systemctl_path, "--system", "enable", unit_name)
525
+ .and_return(shell_out_success)
526
526
  provider.action_enable
527
527
  end
528
528
 
@@ -541,8 +541,8 @@ describe Chef::Provider::SystemdUnit do
541
541
  it "disables the unit when it is enabled" do
542
542
  current_resource.enabled(true)
543
543
  expect(provider).to receive(:shell_out_compacted!)
544
- .with(systemctl_path, "--system", "disable", unit_name)
545
- .and_return(shell_out_success)
544
+ .with(systemctl_path, "--system", "disable", unit_name)
545
+ .and_return(shell_out_success)
546
546
  provider.action_disable
547
547
  end
548
548
 
@@ -567,8 +567,8 @@ describe Chef::Provider::SystemdUnit do
567
567
  current_resource.user(user_name)
568
568
  current_resource.masked(false)
569
569
  expect(provider).to receive(:shell_out_compacted!)
570
- .with(systemctl_path, "--user", "mask", unit_name, **user_cmd_opts)
571
- .and_return(shell_out_success)
570
+ .with(systemctl_path, "--user", "mask", unit_name, **user_cmd_opts)
571
+ .and_return(shell_out_success)
572
572
  provider.action_mask
573
573
  end
574
574
 
@@ -583,8 +583,8 @@ describe Chef::Provider::SystemdUnit do
583
583
  current_resource.user(user_name)
584
584
  current_resource.masked(true)
585
585
  expect(provider).to receive(:shell_out_compacted!)
586
- .with(systemctl_path, "--user", "unmask", unit_name, **user_cmd_opts)
587
- .and_return(shell_out_success)
586
+ .with(systemctl_path, "--user", "unmask", unit_name, **user_cmd_opts)
587
+ .and_return(shell_out_success)
588
588
  provider.action_unmask
589
589
  end
590
590
 
@@ -600,8 +600,8 @@ describe Chef::Provider::SystemdUnit do
600
600
  it "masks the unit when it is unmasked" do
601
601
  current_resource.masked(false)
602
602
  expect(provider).to receive(:shell_out_compacted!)
603
- .with(systemctl_path, "--system", "mask", unit_name)
604
- .and_return(shell_out_success)
603
+ .with(systemctl_path, "--system", "mask", unit_name)
604
+ .and_return(shell_out_success)
605
605
  provider.action_mask
606
606
  end
607
607
 
@@ -614,8 +614,8 @@ describe Chef::Provider::SystemdUnit do
614
614
  it "unmasks the unit when it is masked" do
615
615
  current_resource.masked(true)
616
616
  expect(provider).to receive(:shell_out_compacted!)
617
- .with(systemctl_path, "--system", "unmask", unit_name)
618
- .and_return(shell_out_success)
617
+ .with(systemctl_path, "--system", "unmask", unit_name)
618
+ .and_return(shell_out_success)
619
619
  provider.action_unmask
620
620
  end
621
621
 
@@ -633,8 +633,8 @@ describe Chef::Provider::SystemdUnit do
633
633
  current_resource.user(user_name)
634
634
  current_resource.active(false)
635
635
  expect(provider).to receive(:shell_out_compacted!)
636
- .with(systemctl_path, "--user", "start", unit_name, **user_cmd_opts, default_env: false)
637
- .and_return(shell_out_success)
636
+ .with(systemctl_path, "--user", "start", unit_name, **user_cmd_opts, default_env: false)
637
+ .and_return(shell_out_success)
638
638
  provider.action_start
639
639
  end
640
640
 
@@ -649,8 +649,8 @@ describe Chef::Provider::SystemdUnit do
649
649
  current_resource.user(user_name)
650
650
  current_resource.active(true)
651
651
  expect(provider).to receive(:shell_out_compacted!)
652
- .with(systemctl_path, "--user", "stop", unit_name, **user_cmd_opts, default_env: false)
653
- .and_return(shell_out_success)
652
+ .with(systemctl_path, "--user", "stop", unit_name, **user_cmd_opts, default_env: false)
653
+ .and_return(shell_out_success)
654
654
  provider.action_stop
655
655
  end
656
656
 
@@ -666,8 +666,8 @@ describe Chef::Provider::SystemdUnit do
666
666
  it "starts the unit when it is inactive" do
667
667
  current_resource.active(false)
668
668
  expect(provider).to receive(:shell_out_compacted!)
669
- .with(systemctl_path, "--system", "start", unit_name, default_env: false)
670
- .and_return(shell_out_success)
669
+ .with(systemctl_path, "--system", "start", unit_name, default_env: false)
670
+ .and_return(shell_out_success)
671
671
  provider.action_start
672
672
  end
673
673
 
@@ -680,8 +680,8 @@ describe Chef::Provider::SystemdUnit do
680
680
  it "stops the unit when it is active" do
681
681
  current_resource.active(true)
682
682
  expect(provider).to receive(:shell_out_compacted!)
683
- .with(systemctl_path, "--system", "stop", unit_name, default_env: false)
684
- .and_return(shell_out_success)
683
+ .with(systemctl_path, "--system", "stop", unit_name, default_env: false)
684
+ .and_return(shell_out_success)
685
685
  provider.action_stop
686
686
  end
687
687
 
@@ -698,8 +698,8 @@ describe Chef::Provider::SystemdUnit do
698
698
  it "restarts the unit" do
699
699
  current_resource.user(user_name)
700
700
  expect(provider).to receive(:shell_out_compacted!)
701
- .with(systemctl_path, "--user", "restart", unit_name, **user_cmd_opts, default_env: false)
702
- .and_return(shell_out_success)
701
+ .with(systemctl_path, "--user", "restart", unit_name, **user_cmd_opts, default_env: false)
702
+ .and_return(shell_out_success)
703
703
  provider.action_restart
704
704
  end
705
705
 
@@ -707,8 +707,8 @@ describe Chef::Provider::SystemdUnit do
707
707
  current_resource.user(user_name)
708
708
  current_resource.active(true)
709
709
  expect(provider).to receive(:shell_out_compacted!)
710
- .with(systemctl_path, "--user", "reload", unit_name, **user_cmd_opts, default_env: false)
711
- .and_return(shell_out_success)
710
+ .with(systemctl_path, "--user", "reload", unit_name, **user_cmd_opts, default_env: false)
711
+ .and_return(shell_out_success)
712
712
  provider.action_reload
713
713
  end
714
714
 
@@ -723,16 +723,16 @@ describe Chef::Provider::SystemdUnit do
723
723
  context "when no user is specified" do
724
724
  it "restarts the unit" do
725
725
  expect(provider).to receive(:shell_out_compacted!)
726
- .with(systemctl_path, "--system", "restart", unit_name, default_env: false)
727
- .and_return(shell_out_success)
726
+ .with(systemctl_path, "--system", "restart", unit_name, default_env: false)
727
+ .and_return(shell_out_success)
728
728
  provider.action_restart
729
729
  end
730
730
 
731
731
  it "reloads the unit if active" do
732
732
  current_resource.active(true)
733
733
  expect(provider).to receive(:shell_out_compacted!)
734
- .with(systemctl_path, "--system", "reload", unit_name, default_env: false)
735
- .and_return(shell_out_success)
734
+ .with(systemctl_path, "--system", "reload", unit_name, default_env: false)
735
+ .and_return(shell_out_success)
736
736
  provider.action_reload
737
737
  end
738
738
 
@@ -749,8 +749,8 @@ describe Chef::Provider::SystemdUnit do
749
749
  it "try-restarts the unit" do
750
750
  current_resource.user(user_name)
751
751
  expect(provider).to receive(:shell_out_compacted!)
752
- .with(systemctl_path, "--user", "try-restart", unit_name, **user_cmd_opts, default_env: false)
753
- .and_return(shell_out_success)
752
+ .with(systemctl_path, "--user", "try-restart", unit_name, **user_cmd_opts, default_env: false)
753
+ .and_return(shell_out_success)
754
754
  provider.action_try_restart
755
755
  end
756
756
  end
@@ -758,8 +758,8 @@ describe Chef::Provider::SystemdUnit do
758
758
  context "when no user is specified" do
759
759
  it "try-restarts the unit" do
760
760
  expect(provider).to receive(:shell_out_compacted!)
761
- .with(systemctl_path, "--system", "try-restart", unit_name, default_env: false)
762
- .and_return(shell_out_success)
761
+ .with(systemctl_path, "--system", "try-restart", unit_name, default_env: false)
762
+ .and_return(shell_out_success)
763
763
  provider.action_try_restart
764
764
  end
765
765
  end
@@ -770,8 +770,8 @@ describe Chef::Provider::SystemdUnit do
770
770
  it "reload-or-restarts the unit" do
771
771
  current_resource.user(user_name)
772
772
  expect(provider).to receive(:shell_out_compacted!)
773
- .with(systemctl_path, "--user", "reload-or-restart", unit_name, **user_cmd_opts, default_env: false)
774
- .and_return(shell_out_success)
773
+ .with(systemctl_path, "--user", "reload-or-restart", unit_name, **user_cmd_opts, default_env: false)
774
+ .and_return(shell_out_success)
775
775
  provider.action_reload_or_restart
776
776
  end
777
777
  end
@@ -779,8 +779,8 @@ describe Chef::Provider::SystemdUnit do
779
779
  context "when no user is specified" do
780
780
  it "reload-or-restarts the unit" do
781
781
  expect(provider).to receive(:shell_out_compacted!)
782
- .with(systemctl_path, "--system", "reload-or-restart", unit_name, default_env: false)
783
- .and_return(shell_out_success)
782
+ .with(systemctl_path, "--system", "reload-or-restart", unit_name, default_env: false)
783
+ .and_return(shell_out_success)
784
784
  provider.action_reload_or_restart
785
785
  end
786
786
  end
@@ -791,8 +791,8 @@ describe Chef::Provider::SystemdUnit do
791
791
  it "reload-or-try-restarts the unit" do
792
792
  current_resource.user(user_name)
793
793
  expect(provider).to receive(:shell_out_compacted!)
794
- .with(systemctl_path, "--user", "reload-or-try-restart", unit_name, **user_cmd_opts, default_env: false)
795
- .and_return(shell_out_success)
794
+ .with(systemctl_path, "--user", "reload-or-try-restart", unit_name, **user_cmd_opts, default_env: false)
795
+ .and_return(shell_out_success)
796
796
  provider.action_reload_or_try_restart
797
797
  end
798
798
  end
@@ -800,8 +800,8 @@ describe Chef::Provider::SystemdUnit do
800
800
  context "when no user is specified" do
801
801
  it "reload-or-try-restarts the unit" do
802
802
  expect(provider).to receive(:shell_out_compacted!)
803
- .with(systemctl_path, "--system", "reload-or-try-restart", unit_name, default_env: false)
804
- .and_return(shell_out_success)
803
+ .with(systemctl_path, "--system", "reload-or-try-restart", unit_name, default_env: false)
804
+ .and_return(shell_out_success)
805
805
  provider.action_reload_or_try_restart
806
806
  end
807
807
  end
@@ -817,16 +817,16 @@ describe Chef::Provider::SystemdUnit do
817
817
  it "returns true when unit is active" do
818
818
  current_resource.user(user_name)
819
819
  expect(provider).to receive(:shell_out_compacted)
820
- .with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
821
- .and_return(shell_out_success)
820
+ .with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
821
+ .and_return(shell_out_success)
822
822
  expect(provider.active?).to be true
823
823
  end
824
824
 
825
825
  it "returns false when unit is inactive" do
826
826
  current_resource.user(user_name)
827
827
  expect(provider).to receive(:shell_out_compacted)
828
- .with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
829
- .and_return(shell_out_failure)
828
+ .with(systemctl_path, "--user", "is-active", unit_name, user_cmd_opts)
829
+ .and_return(shell_out_failure)
830
830
  expect(provider.active?).to be false
831
831
  end
832
832
  end
@@ -834,15 +834,15 @@ describe Chef::Provider::SystemdUnit do
834
834
  context "when no user is specified" do
835
835
  it "returns true when unit is active" do
836
836
  expect(provider).to receive(:shell_out_compacted)
837
- .with(systemctl_path, "--system", "is-active", unit_name)
838
- .and_return(shell_out_success)
837
+ .with(systemctl_path, "--system", "is-active", unit_name)
838
+ .and_return(shell_out_success)
839
839
  expect(provider.active?).to be true
840
840
  end
841
841
 
842
842
  it "returns false when unit is not active" do
843
843
  expect(provider).to receive(:shell_out_compacted)
844
- .with(systemctl_path, "--system", "is-active", unit_name)
845
- .and_return(shell_out_failure)
844
+ .with(systemctl_path, "--system", "is-active", unit_name)
845
+ .and_return(shell_out_failure)
846
846
  expect(provider.active?).to be false
847
847
  end
848
848
  end
@@ -858,8 +858,8 @@ describe Chef::Provider::SystemdUnit do
858
858
  it "returns true when unit is enabled" do
859
859
  current_resource.user(user_name)
860
860
  expect(provider).to receive(:shell_out_compacted)
861
- .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
862
- .and_return(shell_out_success)
861
+ .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
862
+ .and_return(shell_out_success)
863
863
  expect(provider.enabled?).to be true
864
864
  end
865
865
 
@@ -875,8 +875,8 @@ describe Chef::Provider::SystemdUnit do
875
875
  context "when no user is specified" do
876
876
  it "returns true when unit is enabled" do
877
877
  expect(provider).to receive(:shell_out_compacted)
878
- .with(systemctl_path, "--system", "is-enabled", unit_name)
879
- .and_return(shell_out_success)
878
+ .with(systemctl_path, "--system", "is-enabled", unit_name)
879
+ .and_return(shell_out_success)
880
880
  expect(provider.enabled?).to be true
881
881
  end
882
882
 
@@ -899,16 +899,16 @@ describe Chef::Provider::SystemdUnit do
899
899
  it "returns true when the unit is masked" do
900
900
  current_resource.user(user_name)
901
901
  expect(provider).to receive(:shell_out_compacted)
902
- .with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
903
- .and_return(shell_out_masked)
902
+ .with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
903
+ .and_return(shell_out_masked)
904
904
  expect(provider.masked?).to be true
905
905
  end
906
906
 
907
907
  it "returns false when the unit is not masked" do
908
908
  current_resource.user(user_name)
909
909
  expect(provider).to receive(:shell_out_compacted)
910
- .with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
911
- .and_return(shell_out_static)
910
+ .with(systemctl_path, "--user", "status", unit_name, user_cmd_opts)
911
+ .and_return(shell_out_static)
912
912
  expect(provider.masked?).to be false
913
913
  end
914
914
  end
@@ -916,15 +916,15 @@ describe Chef::Provider::SystemdUnit do
916
916
  context "when no user is specified" do
917
917
  it "returns true when the unit is masked" do
918
918
  expect(provider).to receive(:shell_out_compacted)
919
- .with(systemctl_path, "--system", "status", unit_name)
920
- .and_return(shell_out_masked)
919
+ .with(systemctl_path, "--system", "status", unit_name)
920
+ .and_return(shell_out_masked)
921
921
  expect(provider.masked?).to be true
922
922
  end
923
923
 
924
924
  it "returns false when the unit is not masked" do
925
925
  expect(provider).to receive(:shell_out_compacted)
926
- .with(systemctl_path, "--system", "status", unit_name)
927
- .and_return(shell_out_static)
926
+ .with(systemctl_path, "--system", "status", unit_name)
927
+ .and_return(shell_out_static)
928
928
  expect(provider.masked?).to be false
929
929
  end
930
930
  end
@@ -940,16 +940,16 @@ describe Chef::Provider::SystemdUnit do
940
940
  it "returns true when the unit is static" do
941
941
  current_resource.user(user_name)
942
942
  expect(provider).to receive(:shell_out_compacted)
943
- .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
944
- .and_return(shell_out_static)
943
+ .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
944
+ .and_return(shell_out_static)
945
945
  expect(provider.static?).to be true
946
946
  end
947
947
 
948
948
  it "returns false when the unit is not static" do
949
949
  current_resource.user(user_name)
950
950
  expect(provider).to receive(:shell_out_compacted)
951
- .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
952
- .and_return(shell_out_masked)
951
+ .with(systemctl_path, "--user", "is-enabled", unit_name, user_cmd_opts)
952
+ .and_return(shell_out_masked)
953
953
  expect(provider.static?).to be false
954
954
  end
955
955
  end
@@ -957,15 +957,15 @@ describe Chef::Provider::SystemdUnit do
957
957
  context "when no user is specified" do
958
958
  it "returns true when the unit is static" do
959
959
  expect(provider).to receive(:shell_out_compacted)
960
- .with(systemctl_path, "--system", "is-enabled", unit_name)
961
- .and_return(shell_out_static)
960
+ .with(systemctl_path, "--system", "is-enabled", unit_name)
961
+ .and_return(shell_out_static)
962
962
  expect(provider.static?).to be true
963
963
  end
964
964
 
965
965
  it "returns false when the unit is not static" do
966
966
  expect(provider).to receive(:shell_out_compacted)
967
- .with(systemctl_path, "--system", "is-enabled", unit_name)
968
- .and_return(shell_out_masked)
967
+ .with(systemctl_path, "--system", "is-enabled", unit_name)
968
+ .and_return(shell_out_masked)
969
969
  expect(provider.static?).to be false
970
970
  end
971
971
  end