chef 12.6.0 → 12.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1449) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +26 -19
  3. data/README.md +26 -23
  4. data/Rakefile +28 -17
  5. data/VERSION +1 -0
  6. data/acceptance/.gitignore +1 -0
  7. data/acceptance/.shared/kitchen_acceptance/.kitchen.digitalocean.yml +27 -0
  8. data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +281 -0
  9. data/acceptance/.shared/kitchen_acceptance/.kitchen.vagrant.yml +49 -0
  10. data/acceptance/.shared/kitchen_acceptance/libraries/kitchen.rb +46 -0
  11. data/acceptance/.shared/kitchen_acceptance/metadata.rb +1 -0
  12. data/acceptance/Gemfile +11 -0
  13. data/acceptance/README.md +86 -0
  14. data/acceptance/basics/.acceptance/acceptance-cookbook/.gitignore +2 -0
  15. data/acceptance/basics/.acceptance/acceptance-cookbook/metadata.rb +3 -0
  16. data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
  17. data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
  18. data/acceptance/basics/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
  19. data/acceptance/basics/.kitchen.yml +4 -0
  20. data/acceptance/basics/test/integration/chef-current-install/serverspec/chef_client_spec.rb +19 -0
  21. data/acceptance/basics/test/integration/chef-current-install/serverspec/spec_helper.rb +6 -0
  22. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/.gitignore +2 -0
  23. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/cookbook_kitchen.rb +43 -0
  24. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/libraries/top_cookbooks.rb +21 -0
  25. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/metadata.rb +3 -0
  26. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
  27. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
  28. data/acceptance/top-cookbooks/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
  29. data/acceptance/top-cookbooks/.gitignore +1 -0
  30. data/acceptance/top-cookbooks/.kitchen.git.yml +10 -0
  31. data/acceptance/top-cookbooks/.kitchen.learn-the-basics-rhel.yml +4 -0
  32. data/acceptance/top-cookbooks/.kitchen.learn-the-basics-ubuntu.yml +4 -0
  33. data/acceptance/top-cookbooks/.kitchen.learn-the-basics-windows.yml +4 -0
  34. data/acceptance/trivial/.acceptance/acceptance-cookbook/.gitignore +2 -0
  35. data/acceptance/trivial/.acceptance/acceptance-cookbook/metadata.rb +2 -0
  36. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
  37. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
  38. data/acceptance/trivial/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
  39. data/acceptance/trivial/.kitchen.yml +7 -0
  40. data/acceptance/trivial/test/integration/chef-current-install/inspec/chef_client_spec.rb +5 -0
  41. data/acceptance/windows-service/.acceptance/acceptance-cookbook/.gitignore +2 -0
  42. data/acceptance/windows-service/.acceptance/acceptance-cookbook/metadata.rb +2 -0
  43. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/destroy.rb +1 -0
  44. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/provision.rb +1 -0
  45. data/acceptance/windows-service/.acceptance/acceptance-cookbook/recipes/verify.rb +1 -0
  46. data/acceptance/windows-service/.kitchen.yml +7 -0
  47. data/acceptance/windows-service/test/integration/chef-windows-service/inspec/chef_windows_service_spec.rb +58 -0
  48. data/bin/chef-apply +3 -3
  49. data/bin/chef-client +5 -5
  50. data/bin/chef-shell +1 -1
  51. data/bin/chef-solo +4 -4
  52. data/bin/knife +4 -5
  53. data/chef-windows.gemspec +5 -2
  54. data/chef.gemspec +13 -13
  55. data/distro/common/html/_static/basic.css +1 -1
  56. data/distro/common/html/_static/doctools.js +1 -1
  57. data/distro/common/html/_static/searchtools.js +1 -1
  58. data/distro/common/html/_static/websupport.js +1 -1
  59. data/lib-backcompat/chef/chef_fs/file_system/acl_entry.rb +5 -0
  60. data/lib-backcompat/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +5 -0
  61. data/lib-backcompat/chef/chef_fs/file_system/chef_server_root_dir.rb +5 -0
  62. data/lib/chef.rb +17 -17
  63. data/lib/chef/api_client.rb +31 -30
  64. data/lib/chef/api_client/registration.rb +34 -10
  65. data/lib/chef/api_client_v1.rb +36 -36
  66. data/lib/chef/application.rb +32 -23
  67. data/lib/chef/application/apply.rb +20 -20
  68. data/lib/chef/application/client.rb +63 -43
  69. data/lib/chef/application/knife.rb +21 -15
  70. data/lib/chef/application/solo.rb +52 -41
  71. data/lib/chef/application/windows_service.rb +25 -25
  72. data/lib/chef/application/windows_service_manager.rb +22 -22
  73. data/lib/chef/applications.rb +4 -4
  74. data/lib/chef/audit/audit_event_proxy.rb +3 -3
  75. data/lib/chef/audit/audit_reporter.rb +8 -10
  76. data/lib/chef/audit/control_group_data.rb +9 -10
  77. data/lib/chef/audit/logger.rb +3 -3
  78. data/lib/chef/audit/rspec_formatter.rb +2 -2
  79. data/lib/chef/audit/runner.rb +15 -14
  80. data/lib/chef/chef_class.rb +10 -7
  81. data/lib/chef/chef_fs.rb +51 -1
  82. data/lib/chef/chef_fs/chef_fs_data_store.rb +320 -125
  83. data/lib/chef/chef_fs/command_line.rb +8 -8
  84. data/lib/chef/chef_fs/config.rb +52 -23
  85. data/lib/chef/chef_fs/data_handler/acl_data_handler.rb +10 -10
  86. data/lib/chef/chef_fs/data_handler/client_data_handler.rb +12 -12
  87. data/lib/chef/chef_fs/data_handler/container_data_handler.rb +6 -6
  88. data/lib/chef/chef_fs/data_handler/cookbook_data_handler.rb +15 -15
  89. data/lib/chef/chef_fs/data_handler/data_bag_item_data_handler.rb +11 -11
  90. data/lib/chef/chef_fs/data_handler/data_handler_base.rb +8 -8
  91. data/lib/chef/chef_fs/data_handler/environment_data_handler.rb +14 -14
  92. data/lib/chef/chef_fs/data_handler/group_data_handler.rb +18 -18
  93. data/lib/chef/chef_fs/data_handler/node_data_handler.rb +14 -14
  94. data/lib/chef/chef_fs/data_handler/organization_data_handler.rb +9 -9
  95. data/lib/chef/chef_fs/data_handler/organization_invites_data_handler.rb +2 -2
  96. data/lib/chef/chef_fs/data_handler/organization_members_data_handler.rb +2 -2
  97. data/lib/chef/chef_fs/data_handler/policy_data_handler.rb +30 -3
  98. data/lib/chef/chef_fs/data_handler/policy_group_data_handler.rb +27 -0
  99. data/lib/chef/chef_fs/data_handler/role_data_handler.rb +16 -16
  100. data/lib/chef/chef_fs/data_handler/user_data_handler.rb +12 -12
  101. data/lib/chef/chef_fs/file_pattern.rb +25 -25
  102. data/lib/chef/chef_fs/file_system.rb +10 -10
  103. data/lib/chef/chef_fs/file_system/already_exists_error.rb +3 -6
  104. data/lib/chef/chef_fs/file_system/base_fs_dir.rb +4 -4
  105. data/lib/chef/chef_fs/file_system/base_fs_object.rb +8 -8
  106. data/lib/chef/chef_fs/file_system/chef_server/acl_dir.rb +65 -0
  107. data/lib/chef/chef_fs/file_system/chef_server/acl_entry.rb +60 -0
  108. data/lib/chef/chef_fs/file_system/chef_server/acls_dir.rb +75 -0
  109. data/lib/chef/chef_fs/file_system/chef_server/chef_server_root_dir.rb +196 -0
  110. data/lib/chef/chef_fs/file_system/{chef_repository_file_system_acls_dir.rb → chef_server/cookbook_artifact_dir.rb} +13 -12
  111. data/lib/chef/chef_fs/file_system/chef_server/cookbook_artifacts_dir.rb +102 -0
  112. data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +222 -0
  113. data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +84 -0
  114. data/lib/chef/chef_fs/file_system/chef_server/cookbook_subdir.rb +61 -0
  115. data/lib/chef/chef_fs/file_system/chef_server/cookbooks_acl_dir.rb +42 -0
  116. data/lib/chef/chef_fs/file_system/chef_server/cookbooks_dir.rb +102 -0
  117. data/lib/chef/chef_fs/file_system/chef_server/data_bag_dir.rb +71 -0
  118. data/lib/chef/chef_fs/file_system/chef_server/data_bags_dir.rb +69 -0
  119. data/lib/chef/chef_fs/file_system/chef_server/environments_dir.rb +57 -0
  120. data/lib/chef/chef_fs/file_system/chef_server/nodes_dir.rb +53 -0
  121. data/lib/chef/chef_fs/file_system/chef_server/org_entry.rb +31 -0
  122. data/lib/chef/chef_fs/file_system/chef_server/organization_invites_entry.rb +61 -0
  123. data/lib/chef/chef_fs/file_system/chef_server/organization_members_entry.rb +60 -0
  124. data/lib/chef/chef_fs/file_system/chef_server/policies_acl_dir.rb +41 -0
  125. data/lib/chef/chef_fs/file_system/chef_server/policies_dir.rb +160 -0
  126. data/lib/chef/chef_fs/file_system/chef_server/policy_group_entry.rb +137 -0
  127. data/lib/chef/chef_fs/file_system/chef_server/policy_groups_dir.rb +43 -0
  128. data/lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb +34 -0
  129. data/lib/chef/chef_fs/file_system/chef_server/rest_list_dir.rb +178 -0
  130. data/lib/chef/chef_fs/file_system/chef_server/rest_list_entry.rb +187 -0
  131. data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbook_dir.rb +45 -0
  132. data/lib/chef/chef_fs/file_system/chef_server/versioned_cookbooks_dir.rb +107 -0
  133. data/lib/chef/chef_fs/file_system/cookbook_frozen_error.rb +3 -6
  134. data/lib/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +3 -7
  135. data/lib/chef/chef_fs/file_system/file_system_error.rb +14 -3
  136. data/lib/chef/chef_fs/file_system/memory/memory_dir.rb +53 -0
  137. data/lib/chef/chef_fs/file_system/memory/memory_file.rb +20 -0
  138. data/lib/chef/chef_fs/file_system/memory/memory_root.rb +23 -0
  139. data/lib/chef/chef_fs/file_system/multiplexed_dir.rb +2 -2
  140. data/lib/chef/chef_fs/file_system/must_delete_recursively_error.rb +3 -6
  141. data/lib/chef/chef_fs/file_system/nonexistent_fs_object.rb +4 -4
  142. data/lib/chef/chef_fs/file_system/not_found_error.rb +3 -6
  143. data/lib/chef/chef_fs/file_system/operation_failed_error.rb +5 -5
  144. data/lib/chef/chef_fs/file_system/operation_not_allowed_error.rb +16 -18
  145. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_acls_dir.rb +39 -0
  146. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_artifact_dir.rb +41 -0
  147. data/lib/chef/chef_fs/file_system/{chef_repository_file_system_policies_dir.rb → repository/chef_repository_file_system_cookbook_artifacts_dir.rb} +9 -13
  148. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +95 -0
  149. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +82 -0
  150. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbooks_dir.rb +84 -0
  151. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_data_bags_dir.rb +38 -0
  152. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +83 -0
  153. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_policies_dir.rb +38 -0
  154. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +210 -0
  155. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_versioned_cookbook_dir.rb +42 -0
  156. data/lib/chef/chef_fs/file_system/{chef_repository_file_system_data_bags_dir.rb → repository/chef_repository_file_system_versioned_cookbooks_dir.rb} +9 -11
  157. data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +117 -0
  158. data/lib/chef/chef_fs/file_system/{file_system_root_dir.rb → repository/file_system_root_dir.rb} +8 -6
  159. data/lib/chef/chef_fs/knife.rb +16 -16
  160. data/lib/chef/chef_fs/parallelizer.rb +3 -3
  161. data/lib/chef/chef_fs/parallelizer/flatten_enumerable.rb +1 -1
  162. data/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb +3 -3
  163. data/lib/chef/chef_fs/path_utils.rb +11 -10
  164. data/lib/chef/client.rb +80 -71
  165. data/lib/chef/config.rb +10 -10
  166. data/lib/chef/config_fetcher.rb +12 -4
  167. data/lib/chef/constants.rb +2 -1
  168. data/lib/chef/cookbook/chefignore.rb +4 -5
  169. data/lib/chef/cookbook/cookbook_collection.rb +6 -6
  170. data/lib/chef/cookbook/cookbook_version_loader.rb +15 -15
  171. data/lib/chef/cookbook/file_system_file_vendor.rb +4 -4
  172. data/lib/chef/cookbook/file_vendor.rb +3 -4
  173. data/lib/chef/cookbook/metadata.rb +108 -107
  174. data/lib/chef/cookbook/remote_file_vendor.rb +7 -7
  175. data/lib/chef/cookbook/synchronizer.rb +11 -10
  176. data/lib/chef/cookbook/syntax_check.rb +14 -14
  177. data/lib/chef/cookbook_loader.rb +14 -14
  178. data/lib/chef/cookbook_manifest.rb +16 -15
  179. data/lib/chef/cookbook_site_streaming_uploader.rb +22 -22
  180. data/lib/chef/cookbook_uploader.rb +22 -21
  181. data/lib/chef/cookbook_version.rb +87 -87
  182. data/lib/chef/daemon.rb +6 -6
  183. data/lib/chef/data_bag.rb +32 -26
  184. data/lib/chef/data_bag_item.rb +43 -40
  185. data/lib/chef/delayed_evaluator.rb +1 -1
  186. data/lib/chef/deprecation/mixin/template.rb +4 -4
  187. data/lib/chef/deprecation/provider/cookbook_file.rb +2 -3
  188. data/lib/chef/deprecation/provider/file.rb +10 -10
  189. data/lib/chef/deprecation/provider/remote_directory.rb +5 -5
  190. data/lib/chef/deprecation/provider/remote_file.rb +3 -3
  191. data/lib/chef/deprecation/provider/template.rb +3 -3
  192. data/lib/chef/deprecation/warnings.rb +2 -2
  193. data/lib/chef/digester.rb +6 -6
  194. data/lib/chef/dsl.rb +6 -6
  195. data/lib/chef/dsl/audit.rb +4 -4
  196. data/lib/chef/dsl/chef_provisioning.rb +5 -5
  197. data/lib/chef/dsl/cheffish.rb +5 -5
  198. data/lib/chef/dsl/data_query.rb +10 -10
  199. data/lib/chef/dsl/declare_resource.rb +8 -8
  200. data/lib/chef/dsl/definitions.rb +1 -2
  201. data/lib/chef/dsl/include_attribute.rb +4 -6
  202. data/lib/chef/dsl/include_recipe.rb +4 -4
  203. data/lib/chef/dsl/platform_introspection.rb +8 -14
  204. data/lib/chef/dsl/powershell.rb +3 -3
  205. data/lib/chef/dsl/reboot_pending.rb +12 -13
  206. data/lib/chef/dsl/recipe.rb +20 -20
  207. data/lib/chef/dsl/registry_helper.rb +7 -3
  208. data/lib/chef/dsl/resources.rb +6 -5
  209. data/lib/chef/encrypted_data_bag_item.rb +10 -10
  210. data/lib/chef/encrypted_data_bag_item/assertions.rb +4 -4
  211. data/lib/chef/encrypted_data_bag_item/check_encrypted.rb +3 -3
  212. data/lib/chef/encrypted_data_bag_item/decryption_failure.rb +2 -2
  213. data/lib/chef/encrypted_data_bag_item/decryptor.rb +16 -14
  214. data/lib/chef/encrypted_data_bag_item/encrypted_data_bag_item_assertions.rb +1 -1
  215. data/lib/chef/encrypted_data_bag_item/encryption_failure.rb +1 -1
  216. data/lib/chef/encrypted_data_bag_item/encryptor.rb +20 -20
  217. data/lib/chef/encrypted_data_bag_item/unacceptable_encrypted_data_bag_item_format.rb +2 -2
  218. data/lib/chef/encrypted_data_bag_item/unsupported_cipher.rb +2 -2
  219. data/lib/chef/encrypted_data_bag_item/unsupported_encrypted_data_bag_item_format.rb +2 -2
  220. data/lib/chef/environment.rb +41 -34
  221. data/lib/chef/event_dispatch/base.rb +2 -2
  222. data/lib/chef/event_dispatch/dispatcher.rb +2 -2
  223. data/lib/chef/event_dispatch/dsl.rb +6 -5
  224. data/lib/chef/event_loggers/base.rb +3 -3
  225. data/lib/chef/event_loggers/windows_eventlog.rb +11 -11
  226. data/lib/chef/exceptions.rb +23 -34
  227. data/lib/chef/file_access_control.rb +6 -6
  228. data/lib/chef/file_access_control/unix.rb +5 -5
  229. data/lib/chef/file_access_control/windows.rb +5 -5
  230. data/lib/chef/file_cache.rb +21 -21
  231. data/lib/chef/file_content_management/content_base.rb +2 -2
  232. data/lib/chef/file_content_management/deploy.rb +5 -6
  233. data/lib/chef/file_content_management/deploy/cp.rb +2 -2
  234. data/lib/chef/file_content_management/deploy/mv_unix.rb +2 -3
  235. data/lib/chef/file_content_management/deploy/mv_windows.rb +4 -6
  236. data/lib/chef/file_content_management/tempfile.rb +3 -3
  237. data/lib/chef/formatters/base.rb +8 -9
  238. data/lib/chef/formatters/doc.rb +7 -7
  239. data/lib/chef/formatters/error_descriptor.rb +5 -5
  240. data/lib/chef/formatters/error_inspectors.rb +5 -5
  241. data/lib/chef/formatters/error_inspectors/api_error_formatting.rb +50 -15
  242. data/lib/chef/formatters/error_inspectors/compile_error_inspector.rb +11 -11
  243. data/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +8 -8
  244. data/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +8 -6
  245. data/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +14 -13
  246. data/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +19 -17
  247. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +8 -11
  248. data/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +15 -14
  249. data/lib/chef/formatters/error_mapper.rb +2 -2
  250. data/lib/chef/formatters/indentable_output_stream.rb +5 -5
  251. data/lib/chef/formatters/minimal.rb +7 -9
  252. data/lib/chef/guard_interpreter.rb +3 -3
  253. data/lib/chef/guard_interpreter/default_guard_interpreter.rb +3 -4
  254. data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +9 -9
  255. data/lib/chef/handler.rb +4 -4
  256. data/lib/chef/handler/error_report.rb +4 -4
  257. data/lib/chef/handler/json_file.rb +5 -5
  258. data/lib/chef/http.rb +32 -35
  259. data/lib/chef/http/auth_credentials.rb +12 -12
  260. data/lib/chef/http/authenticator.rb +17 -12
  261. data/lib/chef/http/basic_client.rb +20 -20
  262. data/lib/chef/http/cookie_jar.rb +7 -7
  263. data/lib/chef/http/cookie_manager.rb +8 -8
  264. data/lib/chef/http/decompressor.rb +7 -9
  265. data/lib/chef/http/http_request.rb +31 -32
  266. data/lib/chef/http/json_input.rb +9 -9
  267. data/lib/chef/http/json_output.rb +9 -9
  268. data/lib/chef/http/json_to_model_output.rb +4 -4
  269. data/lib/chef/http/remote_request_id.rb +6 -6
  270. data/lib/chef/http/simple.rb +23 -5
  271. data/lib/chef/http/simple_json.rb +43 -0
  272. data/lib/chef/http/socketless_chef_zero_client.rb +56 -57
  273. data/lib/chef/http/ssl_policies.rb +9 -9
  274. data/lib/chef/http/validate_content_length.rb +12 -12
  275. data/lib/chef/json_compat.rb +6 -6
  276. data/lib/chef/key.rb +44 -42
  277. data/lib/chef/knife.rb +47 -44
  278. data/lib/chef/knife/bootstrap.rb +32 -32
  279. data/lib/chef/knife/bootstrap/chef_vault_handler.rb +16 -23
  280. data/lib/chef/knife/bootstrap/client_builder.rb +15 -13
  281. data/lib/chef/knife/bootstrap/templates/chef-full.erb +1 -1
  282. data/lib/chef/knife/client_bulk_delete.rb +5 -5
  283. data/lib/chef/knife/client_create.rb +5 -5
  284. data/lib/chef/knife/client_delete.rb +6 -6
  285. data/lib/chef/knife/client_edit.rb +5 -5
  286. data/lib/chef/knife/client_key_create.rb +6 -6
  287. data/lib/chef/knife/client_key_delete.rb +6 -6
  288. data/lib/chef/knife/client_key_edit.rb +8 -9
  289. data/lib/chef/knife/client_key_list.rb +5 -5
  290. data/lib/chef/knife/client_key_show.rb +5 -5
  291. data/lib/chef/knife/client_list.rb +5 -5
  292. data/lib/chef/knife/client_reregister.rb +5 -5
  293. data/lib/chef/knife/client_show.rb +5 -5
  294. data/lib/chef/knife/configure.rb +14 -14
  295. data/lib/chef/knife/configure_client.rb +6 -6
  296. data/lib/chef/knife/cookbook_bulk_delete.rb +9 -10
  297. data/lib/chef/knife/cookbook_create.rb +12 -12
  298. data/lib/chef/knife/cookbook_delete.rb +10 -10
  299. data/lib/chef/knife/cookbook_download.rb +8 -10
  300. data/lib/chef/knife/cookbook_list.rb +5 -5
  301. data/lib/chef/knife/cookbook_metadata.rb +8 -8
  302. data/lib/chef/knife/cookbook_metadata_from_file.rb +5 -5
  303. data/lib/chef/knife/cookbook_show.rb +14 -18
  304. data/lib/chef/knife/cookbook_site_download.rb +22 -22
  305. data/lib/chef/knife/cookbook_site_install.rb +10 -10
  306. data/lib/chef/knife/cookbook_site_list.rb +6 -10
  307. data/lib/chef/knife/cookbook_site_search.rb +5 -10
  308. data/lib/chef/knife/cookbook_site_share.rb +17 -18
  309. data/lib/chef/knife/cookbook_site_show.rb +7 -12
  310. data/lib/chef/knife/cookbook_site_unshare.rb +6 -6
  311. data/lib/chef/knife/cookbook_site_vendor.rb +5 -5
  312. data/lib/chef/knife/cookbook_test.rb +6 -7
  313. data/lib/chef/knife/cookbook_upload.rb +19 -20
  314. data/lib/chef/knife/core/bootstrap_context.rb +25 -21
  315. data/lib/chef/knife/core/cookbook_scm_repo.rb +11 -12
  316. data/lib/chef/knife/core/custom_manifest_loader.rb +2 -2
  317. data/lib/chef/knife/core/gem_glob_loader.rb +11 -11
  318. data/lib/chef/knife/core/generic_presenter.rb +33 -34
  319. data/lib/chef/knife/core/hashed_command_loader.rb +6 -6
  320. data/lib/chef/knife/core/node_editor.rb +59 -38
  321. data/lib/chef/knife/core/node_presenter.rb +13 -14
  322. data/lib/chef/knife/core/object_loader.rb +9 -9
  323. data/lib/chef/knife/core/status_presenter.rb +17 -17
  324. data/lib/chef/knife/core/subcommand_loader.rb +19 -20
  325. data/lib/chef/knife/core/text_formatter.rb +13 -14
  326. data/lib/chef/knife/core/ui.rb +17 -18
  327. data/lib/chef/knife/data_bag_create.rb +11 -10
  328. data/lib/chef/knife/data_bag_delete.rb +6 -8
  329. data/lib/chef/knife/data_bag_edit.rb +8 -11
  330. data/lib/chef/knife/data_bag_from_file.rb +12 -11
  331. data/lib/chef/knife/data_bag_list.rb +4 -8
  332. data/lib/chef/knife/data_bag_secret_options.rb +6 -6
  333. data/lib/chef/knife/data_bag_show.rb +31 -31
  334. data/lib/chef/knife/delete.rb +6 -7
  335. data/lib/chef/knife/deps.rb +18 -18
  336. data/lib/chef/knife/diff.rb +8 -9
  337. data/lib/chef/knife/download.rb +11 -12
  338. data/lib/chef/knife/edit.rb +5 -6
  339. data/lib/chef/knife/environment_compare.rb +23 -23
  340. data/lib/chef/knife/environment_create.rb +5 -5
  341. data/lib/chef/knife/environment_delete.rb +5 -5
  342. data/lib/chef/knife/environment_edit.rb +5 -5
  343. data/lib/chef/knife/environment_from_file.rb +4 -5
  344. data/lib/chef/knife/environment_list.rb +5 -5
  345. data/lib/chef/knife/environment_show.rb +5 -5
  346. data/lib/chef/knife/exec.rb +7 -7
  347. data/lib/chef/knife/help.rb +7 -9
  348. data/lib/chef/knife/index_rebuild.rb +4 -5
  349. data/lib/chef/knife/key_create.rb +5 -5
  350. data/lib/chef/knife/key_create_base.rb +1 -1
  351. data/lib/chef/knife/key_delete.rb +2 -2
  352. data/lib/chef/knife/key_edit.rb +5 -5
  353. data/lib/chef/knife/key_edit_base.rb +1 -1
  354. data/lib/chef/knife/key_list.rb +12 -12
  355. data/lib/chef/knife/key_list_base.rb +1 -1
  356. data/lib/chef/knife/key_show.rb +4 -4
  357. data/lib/chef/knife/list.rb +14 -13
  358. data/lib/chef/knife/node_bulk_delete.rb +6 -12
  359. data/lib/chef/knife/node_create.rb +5 -8
  360. data/lib/chef/knife/node_delete.rb +5 -6
  361. data/lib/chef/knife/node_edit.rb +6 -8
  362. data/lib/chef/knife/node_environment_set.rb +4 -4
  363. data/lib/chef/knife/node_from_file.rb +10 -10
  364. data/lib/chef/knife/node_list.rb +5 -7
  365. data/lib/chef/knife/node_run_list_add.rb +8 -8
  366. data/lib/chef/knife/node_run_list_remove.rb +8 -8
  367. data/lib/chef/knife/node_run_list_set.rb +6 -6
  368. data/lib/chef/knife/node_show.rb +6 -7
  369. data/lib/chef/knife/osc_user_create.rb +5 -5
  370. data/lib/chef/knife/osc_user_delete.rb +5 -5
  371. data/lib/chef/knife/osc_user_edit.rb +5 -5
  372. data/lib/chef/knife/osc_user_list.rb +5 -5
  373. data/lib/chef/knife/osc_user_reregister.rb +5 -5
  374. data/lib/chef/knife/osc_user_show.rb +5 -5
  375. data/lib/chef/knife/raw.rb +18 -17
  376. data/lib/chef/knife/recipe_list.rb +4 -4
  377. data/lib/chef/knife/rehash.rb +9 -9
  378. data/lib/chef/knife/role_bulk_delete.rb +5 -10
  379. data/lib/chef/knife/role_create.rb +5 -7
  380. data/lib/chef/knife/role_delete.rb +5 -6
  381. data/lib/chef/knife/role_edit.rb +5 -8
  382. data/lib/chef/knife/role_env_run_list_add.rb +9 -9
  383. data/lib/chef/knife/role_env_run_list_clear.rb +4 -4
  384. data/lib/chef/knife/role_env_run_list_remove.rb +13 -13
  385. data/lib/chef/knife/role_env_run_list_replace.rb +6 -6
  386. data/lib/chef/knife/role_env_run_list_set.rb +6 -6
  387. data/lib/chef/knife/role_from_file.rb +6 -11
  388. data/lib/chef/knife/role_list.rb +5 -6
  389. data/lib/chef/knife/role_run_list_add.rb +9 -9
  390. data/lib/chef/knife/role_run_list_clear.rb +4 -4
  391. data/lib/chef/knife/role_run_list_remove.rb +13 -13
  392. data/lib/chef/knife/role_run_list_replace.rb +6 -6
  393. data/lib/chef/knife/role_run_list_set.rb +6 -6
  394. data/lib/chef/knife/role_show.rb +5 -8
  395. data/lib/chef/knife/search.rb +11 -11
  396. data/lib/chef/knife/serve.rb +10 -10
  397. data/lib/chef/knife/show.rb +4 -4
  398. data/lib/chef/knife/ssh.rb +34 -34
  399. data/lib/chef/knife/ssl_check.rb +12 -11
  400. data/lib/chef/knife/ssl_fetch.rb +13 -15
  401. data/lib/chef/knife/status.rb +10 -10
  402. data/lib/chef/knife/tag_create.rb +5 -5
  403. data/lib/chef/knife/tag_delete.rb +5 -5
  404. data/lib/chef/knife/tag_list.rb +5 -5
  405. data/lib/chef/knife/upload.rb +10 -11
  406. data/lib/chef/knife/user_create.rb +6 -8
  407. data/lib/chef/knife/user_delete.rb +6 -7
  408. data/lib/chef/knife/user_edit.rb +6 -7
  409. data/lib/chef/knife/user_key_create.rb +7 -7
  410. data/lib/chef/knife/user_key_delete.rb +6 -6
  411. data/lib/chef/knife/user_key_edit.rb +8 -9
  412. data/lib/chef/knife/user_key_list.rb +5 -5
  413. data/lib/chef/knife/user_key_show.rb +5 -5
  414. data/lib/chef/knife/user_list.rb +5 -5
  415. data/lib/chef/knife/user_reregister.rb +6 -7
  416. data/lib/chef/knife/user_show.rb +6 -6
  417. data/lib/chef/knife/xargs.rb +22 -23
  418. data/lib/chef/local_mode.rb +13 -11
  419. data/lib/chef/log.rb +10 -10
  420. data/lib/chef/log/syslog.rb +5 -6
  421. data/lib/chef/log/winevt.rb +12 -12
  422. data/lib/chef/mash.rb +6 -5
  423. data/lib/chef/mixin/api_version_request_handling.rb +1 -1
  424. data/lib/chef/mixin/checksum.rb +4 -4
  425. data/lib/chef/mixin/command.rb +13 -13
  426. data/lib/chef/mixin/command/unix.rb +7 -7
  427. data/lib/chef/mixin/command/windows.rb +6 -7
  428. data/lib/chef/mixin/convert_to_class_name.rb +11 -11
  429. data/lib/chef/mixin/create_path.rb +3 -3
  430. data/lib/chef/mixin/deep_merge.rb +3 -3
  431. data/lib/chef/mixin/deprecation.rb +24 -25
  432. data/lib/chef/mixin/descendants_tracker.rb +2 -3
  433. data/lib/chef/mixin/enforce_ownership_and_permissions.rb +3 -3
  434. data/lib/chef/mixin/file_class.rb +9 -11
  435. data/lib/chef/mixin/from_file.rb +3 -3
  436. data/lib/chef/mixin/get_source_from_package.rb +2 -3
  437. data/lib/chef/mixin/homebrew_user.rb +6 -6
  438. data/lib/chef/mixin/language.rb +5 -5
  439. data/lib/chef/mixin/language_include_attribute.rb +4 -5
  440. data/lib/chef/mixin/language_include_recipe.rb +4 -5
  441. data/lib/chef/mixin/params_validate.rb +38 -18
  442. data/lib/chef/mixin/path_sanity.rb +7 -7
  443. data/lib/chef/mixin/powershell_out.rb +5 -5
  444. data/lib/chef/mixin/powershell_type_coercions.rb +12 -10
  445. data/lib/chef/mixin/properties.rb +8 -8
  446. data/lib/chef/mixin/provides.rb +2 -2
  447. data/lib/chef/mixin/proxified_socket.rb +4 -4
  448. data/lib/chef/mixin/recipe_definition_dsl_core.rb +4 -4
  449. data/lib/chef/mixin/securable.rb +24 -27
  450. data/lib/chef/mixin/shell_out.rb +10 -10
  451. data/lib/chef/mixin/subclass_directive.rb +2 -2
  452. data/lib/chef/mixin/template.rb +8 -9
  453. data/lib/chef/mixin/unformatter.rb +1 -1
  454. data/lib/chef/mixin/uris.rb +2 -3
  455. data/lib/chef/mixin/which.rb +3 -3
  456. data/lib/chef/mixin/why_run.rb +6 -7
  457. data/lib/chef/mixin/wide_string.rb +7 -7
  458. data/lib/chef/mixin/windows_architecture_helper.rb +9 -10
  459. data/lib/chef/mixin/windows_env_helper.rb +10 -11
  460. data/lib/chef/mixin/xml_escape.rb +13 -13
  461. data/lib/chef/mixins.rb +13 -14
  462. data/lib/chef/monkey_patches/net-ssh-multi.rb +6 -6
  463. data/lib/chef/monkey_patches/net_http.rb +2 -2
  464. data/lib/chef/monkey_patches/webrick-utils.rb +6 -6
  465. data/lib/chef/monkey_patches/win32/registry.rb +6 -6
  466. data/lib/chef/monologger.rb +2 -4
  467. data/lib/chef/node.rb +66 -60
  468. data/lib/chef/node/attribute.rb +289 -289
  469. data/lib/chef/node/attribute_collections.rb +8 -8
  470. data/lib/chef/node/immutable_collections.rb +3 -3
  471. data/lib/chef/node_map.rb +11 -11
  472. data/lib/chef/null_logger.rb +3 -3
  473. data/lib/chef/org.rb +31 -30
  474. data/lib/chef/platform.rb +4 -4
  475. data/lib/chef/platform/handler_map.rb +2 -2
  476. data/lib/chef/platform/priority_map.rb +2 -2
  477. data/lib/chef/platform/provider_handler_map.rb +3 -3
  478. data/lib/chef/platform/provider_mapping.rb +33 -33
  479. data/lib/chef/platform/provider_priority_map.rb +2 -2
  480. data/lib/chef/platform/query_helpers.rb +10 -11
  481. data/lib/chef/platform/rebooter.rb +11 -11
  482. data/lib/chef/platform/resource_handler_map.rb +3 -3
  483. data/lib/chef/platform/resource_priority_map.rb +2 -2
  484. data/lib/chef/platform/service_helpers.rb +5 -5
  485. data/lib/chef/policy_builder.rb +5 -5
  486. data/lib/chef/policy_builder/dynamic.rb +10 -11
  487. data/lib/chef/policy_builder/expand_node_object.rb +24 -19
  488. data/lib/chef/policy_builder/policyfile.rb +13 -14
  489. data/lib/chef/property.rb +115 -49
  490. data/lib/chef/provider.rb +43 -43
  491. data/lib/chef/provider/apt_update.rb +79 -0
  492. data/lib/chef/provider/batch.rb +6 -6
  493. data/lib/chef/provider/breakpoint.rb +1 -1
  494. data/lib/chef/provider/cookbook_file.rb +5 -5
  495. data/lib/chef/provider/cookbook_file/content.rb +4 -4
  496. data/lib/chef/provider/cron.rb +8 -8
  497. data/lib/chef/provider/cron/aix.rb +1 -1
  498. data/lib/chef/provider/cron/solaris.rb +1 -1
  499. data/lib/chef/provider/cron/unix.rb +7 -7
  500. data/lib/chef/provider/deploy.rb +7 -8
  501. data/lib/chef/provider/deploy/revision.rb +9 -9
  502. data/lib/chef/provider/deploy/timestamped.rb +1 -1
  503. data/lib/chef/provider/directory.rb +8 -8
  504. data/lib/chef/provider/dsc_resource.rb +33 -27
  505. data/lib/chef/provider/dsc_script.rb +17 -17
  506. data/lib/chef/provider/env.rb +8 -8
  507. data/lib/chef/provider/env/windows.rb +3 -3
  508. data/lib/chef/provider/erl_call.rb +5 -5
  509. data/lib/chef/provider/execute.rb +8 -8
  510. data/lib/chef/provider/file.rb +24 -24
  511. data/lib/chef/provider/file/content.rb +4 -4
  512. data/lib/chef/provider/git.rb +33 -35
  513. data/lib/chef/provider/group.rb +7 -7
  514. data/lib/chef/provider/group/aix.rb +6 -6
  515. data/lib/chef/provider/group/dscl.rb +11 -11
  516. data/lib/chef/provider/group/gpasswd.rb +3 -3
  517. data/lib/chef/provider/group/groupadd.rb +8 -8
  518. data/lib/chef/provider/group/groupmod.rb +3 -3
  519. data/lib/chef/provider/group/pw.rb +2 -2
  520. data/lib/chef/provider/group/suse.rb +5 -5
  521. data/lib/chef/provider/group/usermod.rb +8 -8
  522. data/lib/chef/provider/group/windows.rb +5 -5
  523. data/lib/chef/provider/http_request.rb +15 -15
  524. data/lib/chef/provider/ifconfig.rb +15 -14
  525. data/lib/chef/provider/ifconfig/aix.rb +5 -4
  526. data/lib/chef/provider/ifconfig/debian.rb +6 -6
  527. data/lib/chef/provider/ifconfig/redhat.rb +3 -3
  528. data/lib/chef/provider/link.rb +13 -13
  529. data/lib/chef/provider/log.rb +1 -1
  530. data/lib/chef/provider/lwrp_base.rb +8 -8
  531. data/lib/chef/provider/mdadm.rb +4 -4
  532. data/lib/chef/provider/mount.rb +13 -13
  533. data/lib/chef/provider/mount/aix.rb +14 -14
  534. data/lib/chef/provider/mount/mount.rb +18 -18
  535. data/lib/chef/provider/mount/solaris.rb +30 -30
  536. data/lib/chef/provider/mount/windows.rb +4 -4
  537. data/lib/chef/provider/ohai.rb +2 -2
  538. data/lib/chef/provider/osx_profile.rb +256 -0
  539. data/lib/chef/provider/package.rb +19 -19
  540. data/lib/chef/provider/package/aix.rb +8 -9
  541. data/lib/chef/provider/package/apt.rb +12 -12
  542. data/lib/chef/provider/package/chocolatey.rb +277 -0
  543. data/lib/chef/provider/package/dpkg.rb +7 -7
  544. data/lib/chef/provider/package/easy_install.rb +14 -15
  545. data/lib/chef/provider/package/freebsd/base.rb +7 -7
  546. data/lib/chef/provider/package/freebsd/pkg.rb +8 -8
  547. data/lib/chef/provider/package/freebsd/pkgng.rb +6 -6
  548. data/lib/chef/provider/package/freebsd/port.rb +4 -4
  549. data/lib/chef/provider/package/homebrew.rb +16 -16
  550. data/lib/chef/provider/package/ips.rb +8 -8
  551. data/lib/chef/provider/package/macports.rb +1 -0
  552. data/lib/chef/provider/package/openbsd.rb +13 -13
  553. data/lib/chef/provider/package/pacman.rb +6 -9
  554. data/lib/chef/provider/package/paludis.rb +7 -10
  555. data/lib/chef/provider/package/portage.rb +10 -13
  556. data/lib/chef/provider/package/rpm.rb +7 -8
  557. data/lib/chef/provider/package/rubygems.rb +64 -64
  558. data/lib/chef/provider/package/smartos.rb +7 -10
  559. data/lib/chef/provider/package/solaris.rb +6 -11
  560. data/lib/chef/provider/package/windows.rb +38 -29
  561. data/lib/chef/provider/package/windows/exe.rb +9 -21
  562. data/lib/chef/provider/package/windows/msi.rb +12 -12
  563. data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +7 -7
  564. data/lib/chef/provider/package/yum-dump.py +1 -1
  565. data/lib/chef/provider/package/yum.rb +43 -44
  566. data/lib/chef/provider/package/zypper.rb +57 -47
  567. data/lib/chef/provider/powershell_script.rb +14 -14
  568. data/lib/chef/provider/reboot.rb +5 -5
  569. data/lib/chef/provider/registry_key.rb +16 -16
  570. data/lib/chef/provider/remote_directory.rb +15 -15
  571. data/lib/chef/provider/remote_file.rb +5 -5
  572. data/lib/chef/provider/remote_file/cache_control_data.rb +11 -12
  573. data/lib/chef/provider/remote_file/content.rb +11 -11
  574. data/lib/chef/provider/remote_file/fetcher.rb +2 -2
  575. data/lib/chef/provider/remote_file/ftp.rb +11 -11
  576. data/lib/chef/provider/remote_file/http.rb +9 -9
  577. data/lib/chef/provider/remote_file/local_file.rb +5 -5
  578. data/lib/chef/provider/remote_file/network_file.rb +4 -4
  579. data/lib/chef/provider/route.rb +188 -188
  580. data/lib/chef/provider/ruby_block.rb +3 -3
  581. data/lib/chef/provider/script.rb +5 -5
  582. data/lib/chef/provider/service.rb +30 -30
  583. data/lib/chef/provider/service/aix.rb +4 -4
  584. data/lib/chef/provider/service/aixinit.rb +12 -12
  585. data/lib/chef/provider/service/arch.rb +5 -5
  586. data/lib/chef/provider/service/debian.rb +12 -13
  587. data/lib/chef/provider/service/freebsd.rb +7 -7
  588. data/lib/chef/provider/service/gentoo.rb +5 -5
  589. data/lib/chef/provider/service/init.rb +4 -4
  590. data/lib/chef/provider/service/insserv.rb +4 -4
  591. data/lib/chef/provider/service/invokercd.rb +3 -3
  592. data/lib/chef/provider/service/macosx.rb +19 -19
  593. data/lib/chef/provider/service/openbsd.rb +14 -14
  594. data/lib/chef/provider/service/redhat.rb +6 -6
  595. data/lib/chef/provider/service/simple.rb +10 -9
  596. data/lib/chef/provider/service/solaris.rb +8 -8
  597. data/lib/chef/provider/service/systemd.rb +4 -4
  598. data/lib/chef/provider/service/upstart.rb +8 -8
  599. data/lib/chef/provider/service/windows.rb +32 -78
  600. data/lib/chef/provider/subversion.rb +13 -13
  601. data/lib/chef/provider/template.rb +7 -7
  602. data/lib/chef/provider/template/content.rb +4 -4
  603. data/lib/chef/provider/template_finder.rb +2 -1
  604. data/lib/chef/provider/user.rb +9 -10
  605. data/lib/chef/provider/user/aix.rb +4 -3
  606. data/lib/chef/provider/user/dscl.rb +39 -40
  607. data/lib/chef/provider/user/pw.rb +9 -9
  608. data/lib/chef/provider/user/solaris.rb +9 -9
  609. data/lib/chef/provider/user/useradd.rb +9 -9
  610. data/lib/chef/provider/user/windows.rb +13 -13
  611. data/lib/chef/provider/whyrun_safe_ruby_block.rb +1 -1
  612. data/lib/chef/provider/windows_script.rb +5 -5
  613. data/lib/chef/provider_resolver.rb +3 -3
  614. data/lib/chef/providers.rb +113 -110
  615. data/lib/chef/recipe.rb +13 -14
  616. data/lib/chef/request_id.rb +4 -4
  617. data/lib/chef/resource.rb +103 -93
  618. data/lib/chef/resource/action_class.rb +3 -3
  619. data/lib/chef/resource/apt_package.rb +6 -17
  620. data/lib/chef/{shell/shell_rest.rb → resource/apt_update.rb} +14 -9
  621. data/lib/chef/resource/bash.rb +5 -5
  622. data/lib/chef/resource/batch.rb +4 -4
  623. data/lib/chef/resource/bff_package.rb +3 -3
  624. data/lib/chef/resource/breakpoint.rb +3 -4
  625. data/lib/chef/resource/chef_gem.rb +9 -25
  626. data/lib/chef/resource/chocolatey_package.rb +39 -0
  627. data/lib/chef/resource/conditional.rb +8 -8
  628. data/lib/chef/resource/conditional_action_not_nothing.rb +1 -1
  629. data/lib/chef/resource/cookbook_file.rb +10 -10
  630. data/lib/chef/resource/cron.rb +33 -33
  631. data/lib/chef/resource/csh.rb +5 -5
  632. data/lib/chef/resource/deploy.rb +76 -76
  633. data/lib/chef/resource/deploy_revision.rb +1 -1
  634. data/lib/chef/resource/directory.rb +12 -12
  635. data/lib/chef/resource/dpkg_package.rb +5 -6
  636. data/lib/chef/resource/dsc_resource.rb +121 -120
  637. data/lib/chef/resource/dsc_script.rb +25 -25
  638. data/lib/chef/resource/easy_install_package.rb +6 -25
  639. data/lib/chef/resource/env.rb +9 -9
  640. data/lib/chef/resource/erl_call.rb +15 -15
  641. data/lib/chef/resource/execute.rb +28 -28
  642. data/lib/chef/resource/file.rb +20 -87
  643. data/lib/chef/resource/file/verification.rb +11 -11
  644. data/lib/chef/resource/freebsd_package.rb +10 -9
  645. data/lib/chef/resource/gem_package.rb +8 -23
  646. data/lib/chef/resource/git.rb +4 -4
  647. data/lib/chef/resource/group.rb +18 -19
  648. data/lib/chef/resource/homebrew_package.rb +7 -18
  649. data/lib/chef/resource/http_request.rb +12 -12
  650. data/lib/chef/resource/ifconfig.rb +28 -28
  651. data/lib/chef/resource/ips_package.rb +5 -16
  652. data/lib/chef/resource/ksh.rb +3 -3
  653. data/lib/chef/resource/link.rb +18 -17
  654. data/lib/chef/resource/log.rb +9 -9
  655. data/lib/chef/resource/lwrp_base.rb +10 -10
  656. data/lib/chef/resource/macosx_service.rb +7 -7
  657. data/lib/chef/resource/macports_package.rb +3 -2
  658. data/lib/chef/resource/mdadm.rb +18 -19
  659. data/lib/chef/resource/mount.rb +34 -34
  660. data/lib/chef/resource/ohai.rb +7 -7
  661. data/lib/chef/resource/openbsd_package.rb +7 -6
  662. data/lib/chef/resource/osx_profile.rb +74 -0
  663. data/lib/chef/resource/package.rb +15 -69
  664. data/lib/chef/resource/pacman_package.rb +3 -2
  665. data/lib/chef/resource/paludis_package.rb +5 -7
  666. data/lib/chef/resource/perl.rb +5 -5
  667. data/lib/chef/resource/portage_package.rb +5 -4
  668. data/lib/chef/resource/powershell_script.rb +7 -7
  669. data/lib/chef/resource/python.rb +5 -5
  670. data/lib/chef/resource/reboot.rb +6 -6
  671. data/lib/chef/resource/registry_key.rb +15 -15
  672. data/lib/chef/resource/remote_directory.rb +23 -24
  673. data/lib/chef/resource/remote_file.rb +21 -21
  674. data/lib/chef/resource/resource_notification.rb +2 -2
  675. data/lib/chef/resource/route.rb +26 -26
  676. data/lib/chef/resource/rpm_package.rb +5 -15
  677. data/lib/chef/resource/ruby.rb +5 -5
  678. data/lib/chef/resource/ruby_block.rb +8 -8
  679. data/lib/chef/resource/scm.rb +36 -37
  680. data/lib/chef/resource/script.rb +13 -13
  681. data/lib/chef/resource/service.rb +32 -32
  682. data/lib/chef/resource/smartos_package.rb +4 -3
  683. data/lib/chef/resource/solaris_package.rb +4 -3
  684. data/lib/chef/resource/subversion.rb +6 -6
  685. data/lib/chef/resource/template.rb +19 -19
  686. data/lib/chef/resource/timestamped_deploy.rb +1 -1
  687. data/lib/chef/resource/user.rb +31 -31
  688. data/lib/chef/resource/whyrun_safe_ruby_block.rb +1 -1
  689. data/lib/chef/resource/windows_package.rb +21 -66
  690. data/lib/chef/resource/windows_script.rb +8 -8
  691. data/lib/chef/resource/windows_service.rb +9 -9
  692. data/lib/chef/resource/yum_package.rb +18 -42
  693. data/lib/chef/resource/zypper_package.rb +3 -2
  694. data/lib/chef/resource_builder.rb +4 -4
  695. data/lib/chef/resource_collection.rb +11 -11
  696. data/lib/chef/resource_collection/resource_collection_serialization.rb +5 -5
  697. data/lib/chef/resource_collection/resource_list.rb +6 -6
  698. data/lib/chef/resource_collection/resource_set.rb +6 -6
  699. data/lib/chef/resource_collection/stepable_iterator.rb +4 -4
  700. data/lib/chef/resource_definition.rb +7 -7
  701. data/lib/chef/resource_definition_list.rb +5 -5
  702. data/lib/chef/resource_reporter.rb +14 -15
  703. data/lib/chef/resource_resolver.rb +4 -5
  704. data/lib/chef/resources.rb +71 -68
  705. data/lib/chef/rest.rb +23 -23
  706. data/lib/chef/role.rb +49 -43
  707. data/lib/chef/run_context.rb +21 -23
  708. data/lib/chef/run_context/cookbook_compiler.rb +10 -13
  709. data/lib/chef/run_list.rb +17 -17
  710. data/lib/chef/run_list/run_list_expansion.rb +22 -26
  711. data/lib/chef/run_list/run_list_item.rb +8 -9
  712. data/lib/chef/run_list/versioned_recipe_list.rb +13 -13
  713. data/lib/chef/run_lock.rb +12 -12
  714. data/lib/chef/run_status.rb +3 -3
  715. data/lib/chef/runner.rb +11 -12
  716. data/lib/chef/scan_access_control.rb +7 -7
  717. data/lib/chef/search/query.rb +30 -16
  718. data/lib/chef/server_api.rb +42 -10
  719. data/lib/chef/shell.rb +24 -25
  720. data/lib/chef/shell/ext.rb +31 -31
  721. data/lib/chef/shell/model_wrapper.rb +7 -8
  722. data/lib/chef/shell/shell_session.rb +20 -19
  723. data/lib/chef/shell_out.rb +2 -2
  724. data/lib/chef/tasks/chef_repo.rake +62 -63
  725. data/lib/chef/user.rb +38 -37
  726. data/lib/chef/user_v1.rb +53 -58
  727. data/lib/chef/util/backup.rb +6 -6
  728. data/lib/chef/util/diff.rb +8 -8
  729. data/lib/chef/util/dsc/configuration_generator.rb +11 -11
  730. data/lib/chef/util/dsc/lcm_output_parser.rb +8 -8
  731. data/lib/chef/util/dsc/local_configuration_manager.rb +9 -9
  732. data/lib/chef/util/dsc/resource_info.rb +15 -15
  733. data/lib/chef/util/dsc/resource_store.rb +73 -74
  734. data/lib/chef/util/editor.rb +1 -2
  735. data/lib/chef/util/file_edit.rb +5 -5
  736. data/lib/chef/util/path_helper.rb +2 -2
  737. data/lib/chef/util/powershell/cmdlet.rb +119 -119
  738. data/lib/chef/util/powershell/cmdlet_result.rb +36 -36
  739. data/lib/chef/util/powershell/ps_credential.rb +2 -2
  740. data/lib/chef/util/selinux.rb +6 -6
  741. data/lib/chef/util/threaded_job_queue.rb +2 -2
  742. data/lib/chef/util/windows.rb +1 -1
  743. data/lib/chef/util/windows/net_group.rb +84 -85
  744. data/lib/chef/util/windows/net_use.rb +6 -6
  745. data/lib/chef/util/windows/net_user.rb +9 -8
  746. data/lib/chef/util/windows/volume.rb +3 -3
  747. data/lib/chef/version.rb +2 -2
  748. data/lib/chef/version/platform.rb +5 -5
  749. data/lib/chef/version_class.rb +6 -6
  750. data/lib/chef/version_constraint.rb +13 -13
  751. data/lib/chef/version_constraint/platform.rb +3 -3
  752. data/lib/chef/whitelist.rb +2 -2
  753. data/lib/chef/win32/api.rb +13 -8
  754. data/lib/chef/win32/api/crypto.rb +63 -63
  755. data/lib/chef/win32/api/error.rb +11 -10
  756. data/lib/chef/win32/api/file.rb +17 -16
  757. data/lib/chef/win32/api/installer.rb +15 -16
  758. data/lib/chef/win32/api/memory.rb +4 -4
  759. data/lib/chef/win32/api/net.rb +111 -123
  760. data/lib/chef/win32/api/process.rb +4 -4
  761. data/lib/chef/win32/api/psapi.rb +4 -4
  762. data/lib/chef/win32/api/registry.rb +4 -4
  763. data/lib/chef/win32/api/security.rb +51 -26
  764. data/lib/chef/win32/api/synchronization.rb +4 -4
  765. data/lib/chef/win32/api/system.rb +4 -4
  766. data/lib/chef/win32/api/unicode.rb +4 -4
  767. data/lib/chef/win32/crypto.rb +50 -50
  768. data/lib/chef/win32/error.rb +18 -15
  769. data/lib/chef/win32/eventlog.rb +2 -2
  770. data/lib/chef/win32/file.rb +14 -14
  771. data/lib/chef/win32/file/info.rb +3 -4
  772. data/lib/chef/win32/file/version_info.rb +4 -4
  773. data/lib/chef/win32/handle.rb +6 -6
  774. data/lib/chef/win32/memory.rb +4 -4
  775. data/lib/chef/win32/mutex.rb +4 -4
  776. data/lib/chef/win32/net.rb +26 -59
  777. data/lib/chef/win32/process.rb +7 -7
  778. data/lib/chef/win32/registry.rb +19 -33
  779. data/lib/chef/win32/security.rb +82 -20
  780. data/lib/chef/win32/security/ace.rb +6 -6
  781. data/lib/chef/win32/security/acl.rb +8 -8
  782. data/lib/chef/win32/security/securable_object.rb +5 -5
  783. data/lib/chef/win32/security/security_descriptor.rb +5 -5
  784. data/lib/chef/win32/security/sid.rb +81 -43
  785. data/lib/chef/win32/security/token.rb +6 -6
  786. data/lib/chef/win32/system.rb +4 -4
  787. data/lib/chef/win32/unicode.rb +7 -7
  788. data/lib/chef/win32/version.rb +26 -26
  789. data/lib/chef/workstation_config_loader.rb +2 -2
  790. data/spec/data/apt/chef-integration-test-1.0/debian/copyright +2 -2
  791. data/spec/data/apt/chef-integration-test-1.1/debian/copyright +2 -2
  792. data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +2 -2
  793. data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +1 -1
  794. data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +5 -0
  795. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +1 -1
  796. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +1 -2
  797. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +1 -1
  798. data/spec/functional/application_spec.rb +7 -7
  799. data/spec/functional/assets/chocolatey_feed/test-A.1.0.nupkg +0 -0
  800. data/spec/functional/assets/chocolatey_feed/test-A.1.5.nupkg +0 -0
  801. data/spec/functional/assets/chocolatey_feed/test-A.2.0.nupkg +0 -0
  802. data/spec/functional/assets/chocolatey_feed/test-B.1.0.nupkg +0 -0
  803. data/spec/functional/audit/rspec_formatter_spec.rb +8 -8
  804. data/spec/functional/audit/runner_spec.rb +9 -9
  805. data/spec/functional/dsl/reboot_pending_spec.rb +10 -15
  806. data/spec/functional/dsl/registry_helper_spec.rb +8 -10
  807. data/spec/functional/event_loggers/windows_eventlog_spec.rb +27 -22
  808. data/spec/functional/file_content_management/deploy_strategies_spec.rb +9 -10
  809. data/spec/functional/http/simple_spec.rb +11 -11
  810. data/spec/functional/knife/configure_spec.rb +5 -10
  811. data/spec/functional/knife/cookbook_delete_spec.rb +11 -11
  812. data/spec/functional/knife/exec_spec.rb +6 -6
  813. data/spec/functional/knife/smoke_test.rb +11 -3
  814. data/spec/functional/knife/ssh_spec.rb +22 -22
  815. data/spec/functional/mixin/powershell_out_spec.rb +3 -3
  816. data/spec/functional/mixin/shell_out_spec.rb +12 -12
  817. data/spec/functional/notifications_spec.rb +6 -7
  818. data/spec/functional/provider/remote_file/cache_control_data_spec.rb +11 -12
  819. data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +4 -4
  820. data/spec/functional/rebooter_spec.rb +12 -12
  821. data/spec/functional/resource/aix_service_spec.rb +7 -8
  822. data/spec/functional/resource/aixinit_service_spec.rb +20 -20
  823. data/spec/functional/resource/base.rb +1 -3
  824. data/spec/functional/resource/bash_spec.rb +6 -6
  825. data/spec/functional/resource/batch_spec.rb +5 -5
  826. data/spec/functional/resource/bff_spec.rb +10 -12
  827. data/spec/functional/resource/chocolatey_package_spec.rb +124 -0
  828. data/spec/functional/resource/cookbook_file_spec.rb +9 -9
  829. data/spec/functional/resource/cron_spec.rb +13 -13
  830. data/spec/functional/resource/deploy_revision_spec.rb +18 -18
  831. data/spec/functional/resource/directory_spec.rb +4 -4
  832. data/spec/functional/resource/dpkg_package_spec.rb +38 -38
  833. data/spec/functional/resource/dsc_resource_spec.rb +17 -22
  834. data/spec/functional/resource/dsc_script_spec.rb +104 -106
  835. data/spec/functional/resource/env_spec.rb +30 -30
  836. data/spec/functional/resource/execute_spec.rb +10 -10
  837. data/spec/functional/resource/file_spec.rb +12 -13
  838. data/spec/functional/resource/git_spec.rb +20 -20
  839. data/spec/functional/resource/group_spec.rb +21 -21
  840. data/spec/functional/resource/ifconfig_spec.rb +11 -11
  841. data/spec/functional/resource/link_spec.rb +140 -135
  842. data/spec/functional/resource/mount_spec.rb +17 -29
  843. data/spec/functional/resource/ohai_spec.rb +5 -8
  844. data/spec/functional/resource/package_spec.rb +11 -13
  845. data/spec/functional/resource/powershell_script_spec.rb +60 -60
  846. data/spec/functional/resource/reboot_spec.rb +12 -12
  847. data/spec/functional/resource/registry_spec.rb +71 -72
  848. data/spec/functional/resource/remote_directory_spec.rb +23 -23
  849. data/spec/functional/resource/remote_file_spec.rb +17 -17
  850. data/spec/functional/resource/rpm_spec.rb +14 -14
  851. data/spec/functional/resource/template_spec.rb +8 -8
  852. data/spec/functional/resource/user/dscl_spec.rb +3 -3
  853. data/spec/functional/resource/user/useradd_spec.rb +31 -37
  854. data/spec/functional/resource/user/windows_spec.rb +20 -20
  855. data/spec/functional/resource/windows_package_spec.rb +26 -35
  856. data/spec/functional/resource/windows_service_spec.rb +12 -8
  857. data/spec/functional/rest_spec.rb +6 -5
  858. data/spec/functional/run_lock_spec.rb +15 -14
  859. data/spec/functional/shell_spec.rb +11 -10
  860. data/spec/functional/tiny_server_spec.rb +18 -18
  861. data/spec/functional/util/path_helper_spec.rb +5 -5
  862. data/spec/functional/util/powershell/cmdlet_spec.rb +24 -27
  863. data/spec/functional/version_spec.rb +6 -6
  864. data/spec/functional/win32/crypto_spec.rb +7 -10
  865. data/spec/functional/win32/registry_spec.rb +105 -107
  866. data/spec/functional/win32/security_spec.rb +17 -17
  867. data/spec/functional/win32/service_manager_spec.rb +7 -8
  868. data/spec/functional/win32/sid_spec.rb +13 -13
  869. data/spec/functional/win32/version_info_spec.rb +7 -7
  870. data/spec/functional/win32/versions_spec.rb +13 -13
  871. data/spec/integration/client/client_spec.rb +65 -66
  872. data/spec/integration/client/ipv6_spec.rb +15 -16
  873. data/spec/integration/knife/chef_fs_data_store_spec.rb +432 -246
  874. data/spec/integration/knife/chef_repo_path_spec.rb +261 -261
  875. data/spec/integration/knife/chef_repository_file_system_spec.rb +84 -84
  876. data/spec/integration/knife/chefignore_spec.rb +82 -82
  877. data/spec/integration/knife/common_options_spec.rb +41 -41
  878. data/spec/integration/knife/cookbook_api_ipv6_spec.rb +9 -9
  879. data/spec/integration/knife/delete_spec.rb +262 -248
  880. data/spec/integration/knife/deps_spec.rb +301 -301
  881. data/spec/integration/knife/diff_spec.rb +237 -237
  882. data/spec/integration/knife/download_spec.rb +532 -401
  883. data/spec/integration/knife/list_spec.rb +310 -116
  884. data/spec/integration/knife/raw_spec.rb +39 -39
  885. data/spec/integration/knife/redirection_spec.rb +12 -12
  886. data/spec/integration/knife/serve_spec.rb +12 -12
  887. data/spec/integration/knife/show_spec.rb +59 -59
  888. data/spec/integration/knife/upload_spec.rb +661 -550
  889. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +18 -18
  890. data/spec/integration/recipes/lwrp_spec.rb +7 -7
  891. data/spec/integration/recipes/provider_choice.rb +3 -2
  892. data/spec/integration/recipes/recipe_dsl_spec.rb +151 -124
  893. data/spec/integration/recipes/remote_directory.rb +2 -2
  894. data/spec/integration/recipes/resource_action_spec.rb +439 -328
  895. data/spec/integration/recipes/resource_converge_if_changed_spec.rb +12 -11
  896. data/spec/integration/recipes/resource_load_spec.rb +35 -33
  897. data/spec/integration/solo/solo_spec.rb +31 -32
  898. data/spec/scripts/ssl-serve.rb +12 -17
  899. data/spec/spec_helper.rb +48 -43
  900. data/spec/stress/win32/file_spec.rb +5 -5
  901. data/spec/stress/win32/memory_spec.rb +4 -4
  902. data/spec/stress/win32/security_spec.rb +8 -8
  903. data/spec/support/chef_helpers.rb +5 -6
  904. data/spec/support/key_helpers.rb +2 -2
  905. data/spec/support/lib/chef/provider/easy.rb +2 -2
  906. data/spec/support/lib/chef/provider/openldap_includer.rb +2 -2
  907. data/spec/support/lib/chef/provider/snakeoil.rb +2 -2
  908. data/spec/support/lib/chef/resource/cat.rb +4 -4
  909. data/spec/support/lib/chef/resource/one_two_three_four.rb +2 -2
  910. data/spec/support/lib/chef/resource/openldap_includer.rb +2 -3
  911. data/spec/support/lib/chef/resource/with_state.rb +4 -4
  912. data/spec/support/lib/chef/resource/zen_follower.rb +4 -4
  913. data/spec/support/lib/chef/resource/zen_master.rb +5 -6
  914. data/spec/support/lib/library_load_order.rb +0 -2
  915. data/spec/support/matchers/leak.rb +7 -5
  916. data/spec/support/mock/constant.rb +3 -3
  917. data/spec/support/mock/platform.rb +5 -5
  918. data/spec/support/platform_helpers.rb +36 -23
  919. data/spec/support/platforms/prof/gc.rb +2 -3
  920. data/spec/support/platforms/prof/win32.rb +3 -4
  921. data/spec/support/platforms/win32/spec_service.rb +3 -3
  922. data/spec/support/shared/context/client.rb +22 -14
  923. data/spec/support/shared/context/config.rb +3 -3
  924. data/spec/support/shared/context/win32.rb +9 -9
  925. data/spec/support/shared/examples/client.rb +4 -4
  926. data/spec/support/shared/functional/diff_disabled.rb +1 -1
  927. data/spec/support/shared/functional/directory_resource.rb +8 -8
  928. data/spec/support/shared/functional/file_resource.rb +20 -23
  929. data/spec/support/shared/functional/http.rb +33 -34
  930. data/spec/support/shared/functional/knife.rb +3 -3
  931. data/spec/support/shared/functional/securable_resource.rb +48 -48
  932. data/spec/support/shared/functional/securable_resource_with_reporting.rb +8 -12
  933. data/spec/support/shared/functional/win32_service.rb +3 -5
  934. data/spec/support/shared/functional/windows_script.rb +13 -13
  935. data/spec/support/shared/integration/app_server_support.rb +7 -7
  936. data/spec/support/shared/integration/integration_helper.rb +21 -21
  937. data/spec/support/shared/integration/knife_support.rb +13 -13
  938. data/spec/support/shared/matchers/exit_with_code.rb +2 -2
  939. data/spec/support/shared/matchers/match_environment_variable.rb +2 -2
  940. data/spec/support/shared/unit/api_error_inspector.rb +3 -5
  941. data/spec/support/shared/unit/api_versioning.rb +8 -8
  942. data/spec/support/shared/unit/execute_resource.rb +4 -4
  943. data/spec/support/shared/unit/file_system_support.rb +12 -13
  944. data/spec/support/shared/unit/knife_shared.rb +1 -2
  945. data/spec/support/shared/unit/mock_shellout.rb +5 -2
  946. data/spec/support/shared/unit/platform_introspector.rb +35 -37
  947. data/spec/support/shared/unit/provider/file.rb +29 -40
  948. data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +50 -51
  949. data/spec/support/shared/unit/resource/static_provider_resolution.rb +2 -5
  950. data/spec/support/shared/unit/script_resource.rb +10 -10
  951. data/spec/support/shared/unit/user_and_client_shared.rb +5 -6
  952. data/spec/support/shared/unit/windows_script_resource.rb +6 -7
  953. data/spec/tiny_server.rb +24 -24
  954. data/spec/unit/api_client/registration_spec.rb +41 -38
  955. data/spec/unit/api_client_spec.rb +13 -16
  956. data/spec/unit/api_client_v1_spec.rb +17 -19
  957. data/spec/unit/application/apply_spec.rb +3 -3
  958. data/spec/unit/application/client_spec.rb +12 -9
  959. data/spec/unit/application/knife_spec.rb +69 -17
  960. data/spec/unit/application/solo_spec.rb +29 -48
  961. data/spec/unit/application_spec.rb +171 -151
  962. data/spec/unit/audit/audit_event_proxy_spec.rb +13 -13
  963. data/spec/unit/audit/audit_reporter_spec.rb +18 -25
  964. data/spec/unit/audit/control_group_data_spec.rb +16 -17
  965. data/spec/unit/audit/logger_spec.rb +5 -5
  966. data/spec/unit/audit/rspec_formatter_spec.rb +4 -4
  967. data/spec/unit/audit/runner_spec.rb +11 -12
  968. data/spec/unit/chef_class_spec.rb +5 -5
  969. data/spec/unit/chef_fs/config_spec.rb +14 -18
  970. data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +17 -17
  971. data/spec/unit/chef_fs/diff_spec.rb +75 -75
  972. data/spec/unit/chef_fs/file_pattern_spec.rb +368 -369
  973. data/spec/unit/chef_fs/file_system/cookbook_subdir_spec.rb +9 -9
  974. data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +9 -9
  975. data/spec/unit/chef_fs/file_system_spec.rb +74 -74
  976. data/spec/unit/chef_fs/parallelizer.rb +63 -66
  977. data/spec/unit/chef_fs/path_util_spec.rb +45 -45
  978. data/spec/unit/chef_spec.rb +3 -3
  979. data/spec/unit/client_spec.rb +44 -44
  980. data/spec/unit/config_fetcher_spec.rb +56 -28
  981. data/spec/unit/config_spec.rb +2 -2
  982. data/spec/unit/cookbook/chefignore_spec.rb +12 -12
  983. data/spec/unit/cookbook/cookbook_version_loader_spec.rb +5 -6
  984. data/spec/unit/cookbook/file_vendor_spec.rb +8 -9
  985. data/spec/unit/cookbook/metadata_spec.rb +73 -76
  986. data/spec/unit/cookbook/synchronizer_spec.rb +31 -32
  987. data/spec/unit/cookbook/syntax_check_spec.rb +22 -22
  988. data/spec/unit/cookbook_loader_spec.rb +9 -10
  989. data/spec/unit/cookbook_manifest_spec.rb +27 -28
  990. data/spec/unit/cookbook_site_streaming_uploader_spec.rb +24 -24
  991. data/spec/unit/cookbook_spec.rb +3 -3
  992. data/spec/unit/cookbook_uploader_spec.rb +10 -11
  993. data/spec/unit/cookbook_version_file_specificity_spec.rb +49 -50
  994. data/spec/unit/cookbook_version_spec.rb +45 -48
  995. data/spec/unit/daemon_spec.rb +5 -5
  996. data/spec/unit/data_bag_item_spec.rb +29 -30
  997. data/spec/unit/data_bag_spec.rb +47 -47
  998. data/spec/unit/deprecation_spec.rb +11 -11
  999. data/spec/unit/digester_spec.rb +5 -6
  1000. data/spec/unit/dsl/audit_spec.rb +5 -5
  1001. data/spec/unit/dsl/data_query_spec.rb +12 -12
  1002. data/spec/unit/dsl/platform_introspection_spec.rb +19 -20
  1003. data/spec/unit/dsl/reboot_pending_spec.rb +17 -17
  1004. data/spec/unit/dsl/recipe_spec.rb +4 -6
  1005. data/spec/unit/dsl/regsitry_helper_spec.rb +9 -12
  1006. data/spec/unit/dsl/resources_spec.rb +13 -13
  1007. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +7 -7
  1008. data/spec/unit/encrypted_data_bag_item_spec.rb +11 -11
  1009. data/spec/unit/environment_spec.rb +53 -53
  1010. data/spec/unit/event_dispatch/dispatcher_spec.rb +3 -4
  1011. data/spec/unit/event_dispatch/dsl_spec.rb +16 -16
  1012. data/spec/unit/exceptions_spec.rb +10 -10
  1013. data/spec/unit/file_access_control_spec.rb +32 -32
  1014. data/spec/unit/file_cache_spec.rb +19 -19
  1015. data/spec/unit/file_content_management/deploy/cp_spec.rb +3 -5
  1016. data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +3 -5
  1017. data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +5 -12
  1018. data/spec/unit/formatters/base_spec.rb +29 -6
  1019. data/spec/unit/formatters/doc_spec.rb +7 -7
  1020. data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +9 -10
  1021. data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +11 -11
  1022. data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +4 -7
  1023. data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +3 -3
  1024. data/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +3 -4
  1025. data/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +3 -4
  1026. data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +4 -6
  1027. data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +5 -7
  1028. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +9 -9
  1029. data/spec/unit/guard_interpreter_spec.rb +3 -3
  1030. data/spec/unit/handler/json_file_spec.rb +11 -12
  1031. data/spec/unit/handler_spec.rb +7 -7
  1032. data/spec/unit/http/authenticator_spec.rb +9 -7
  1033. data/spec/unit/http/basic_client_spec.rb +3 -3
  1034. data/spec/unit/http/http_request_spec.rb +22 -22
  1035. data/spec/unit/http/json_input_spec.rb +7 -7
  1036. data/spec/unit/http/simple_spec.rb +3 -3
  1037. data/spec/unit/http/socketless_chef_zero_client_spec.rb +3 -4
  1038. data/spec/unit/http/ssl_policies_spec.rb +18 -19
  1039. data/spec/unit/http/validate_content_length_spec.rb +9 -9
  1040. data/spec/unit/http_spec.rb +18 -18
  1041. data/spec/unit/json_compat_spec.rb +16 -9
  1042. data/spec/unit/key_spec.rb +41 -44
  1043. data/spec/unit/knife/bootstrap/chef_vault_handler_spec.rb +41 -42
  1044. data/spec/unit/knife/bootstrap/client_builder_spec.rb +30 -28
  1045. data/spec/unit/knife/bootstrap_spec.rb +75 -37
  1046. data/spec/unit/knife/client_bulk_delete_spec.rb +6 -6
  1047. data/spec/unit/knife/client_create_spec.rb +11 -12
  1048. data/spec/unit/knife/client_delete_spec.rb +13 -13
  1049. data/spec/unit/knife/client_edit_spec.rb +9 -9
  1050. data/spec/unit/knife/client_list_spec.rb +5 -5
  1051. data/spec/unit/knife/client_reregister_spec.rb +13 -13
  1052. data/spec/unit/knife/client_show_spec.rb +12 -12
  1053. data/spec/unit/knife/configure_client_spec.rb +19 -20
  1054. data/spec/unit/knife/configure_spec.rb +37 -39
  1055. data/spec/unit/knife/cookbook_bulk_delete_spec.rb +17 -19
  1056. data/spec/unit/knife/cookbook_create_spec.rb +32 -32
  1057. data/spec/unit/knife/cookbook_delete_spec.rb +79 -79
  1058. data/spec/unit/knife/cookbook_download_spec.rb +84 -85
  1059. data/spec/unit/knife/cookbook_list_spec.rb +26 -26
  1060. data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +5 -5
  1061. data/spec/unit/knife/cookbook_metadata_spec.rb +55 -55
  1062. data/spec/unit/knife/cookbook_show_spec.rb +33 -34
  1063. data/spec/unit/knife/cookbook_site_download_spec.rb +51 -53
  1064. data/spec/unit/knife/cookbook_site_install_spec.rb +10 -8
  1065. data/spec/unit/knife/cookbook_site_share_spec.rb +42 -42
  1066. data/spec/unit/knife/cookbook_site_unshare_spec.rb +20 -20
  1067. data/spec/unit/knife/cookbook_test_spec.rb +6 -6
  1068. data/spec/unit/knife/cookbook_upload_spec.rb +69 -69
  1069. data/spec/unit/knife/core/bootstrap_context_spec.rb +39 -33
  1070. data/spec/unit/knife/core/cookbook_scm_repo_spec.rb +32 -32
  1071. data/spec/unit/knife/core/custom_manifest_loader_spec.rb +3 -3
  1072. data/spec/unit/knife/core/gem_glob_loader_spec.rb +23 -24
  1073. data/spec/unit/knife/core/hashed_command_loader_spec.rb +8 -8
  1074. data/spec/unit/knife/core/node_editor_spec.rb +211 -0
  1075. data/spec/unit/knife/core/object_loader_spec.rb +12 -12
  1076. data/spec/unit/knife/core/subcommand_loader_spec.rb +10 -10
  1077. data/spec/unit/knife/core/ui_spec.rb +45 -45
  1078. data/spec/unit/knife/data_bag_create_spec.rb +14 -14
  1079. data/spec/unit/knife/data_bag_edit_spec.rb +12 -12
  1080. data/spec/unit/knife/data_bag_from_file_spec.rb +9 -9
  1081. data/spec/unit/knife/data_bag_secret_options_spec.rb +6 -6
  1082. data/spec/unit/knife/data_bag_show_spec.rb +19 -19
  1083. data/spec/unit/knife/environment_compare_spec.rb +32 -32
  1084. data/spec/unit/knife/environment_create_spec.rb +2 -2
  1085. data/spec/unit/knife/environment_delete_spec.rb +2 -2
  1086. data/spec/unit/knife/environment_edit_spec.rb +2 -2
  1087. data/spec/unit/knife/environment_from_file_spec.rb +5 -5
  1088. data/spec/unit/knife/environment_list_spec.rb +4 -4
  1089. data/spec/unit/knife/environment_show_spec.rb +2 -2
  1090. data/spec/unit/knife/index_rebuild_spec.rb +14 -17
  1091. data/spec/unit/knife/key_create_spec.rb +11 -12
  1092. data/spec/unit/knife/key_delete_spec.rb +8 -10
  1093. data/spec/unit/knife/key_edit_spec.rb +14 -17
  1094. data/spec/unit/knife/key_helper.rb +2 -2
  1095. data/spec/unit/knife/key_list_spec.rb +13 -13
  1096. data/spec/unit/knife/key_show_spec.rb +11 -11
  1097. data/spec/unit/knife/knife_help.rb +2 -2
  1098. data/spec/unit/knife/node_bulk_delete_spec.rb +10 -13
  1099. data/spec/unit/knife/node_delete_spec.rb +4 -4
  1100. data/spec/unit/knife/node_edit_spec.rb +17 -18
  1101. data/spec/unit/knife/node_environment_set_spec.rb +4 -4
  1102. data/spec/unit/knife/node_from_file_spec.rb +5 -5
  1103. data/spec/unit/knife/node_list_spec.rb +5 -6
  1104. data/spec/unit/knife/node_run_list_add_spec.rb +5 -8
  1105. data/spec/unit/knife/node_run_list_remove_spec.rb +27 -27
  1106. data/spec/unit/knife/node_run_list_set_spec.rb +4 -4
  1107. data/spec/unit/knife/node_show_spec.rb +6 -6
  1108. data/spec/unit/knife/osc_user_create_spec.rb +7 -7
  1109. data/spec/unit/knife/osc_user_delete_spec.rb +7 -7
  1110. data/spec/unit/knife/osc_user_edit_spec.rb +6 -6
  1111. data/spec/unit/knife/osc_user_list_spec.rb +3 -3
  1112. data/spec/unit/knife/osc_user_reregister_spec.rb +10 -10
  1113. data/spec/unit/knife/osc_user_show_spec.rb +8 -8
  1114. data/spec/unit/knife/raw_spec.rb +6 -6
  1115. data/spec/unit/knife/role_bulk_delete_spec.rb +4 -4
  1116. data/spec/unit/knife/role_create_spec.rb +4 -4
  1117. data/spec/unit/knife/role_delete_spec.rb +4 -4
  1118. data/spec/unit/knife/role_edit_spec.rb +4 -6
  1119. data/spec/unit/knife/role_env_run_list_add_spec.rb +9 -9
  1120. data/spec/unit/knife/role_env_run_list_clear_spec.rb +38 -44
  1121. data/spec/unit/knife/role_env_run_list_remove_spec.rb +46 -52
  1122. data/spec/unit/knife/role_env_run_list_replace_spec.rb +49 -52
  1123. data/spec/unit/knife/role_env_run_list_set_spec.rb +17 -20
  1124. data/spec/unit/knife/role_from_file_spec.rb +7 -7
  1125. data/spec/unit/knife/role_list_spec.rb +5 -7
  1126. data/spec/unit/knife/role_run_list_add_spec.rb +7 -7
  1127. data/spec/unit/knife/role_run_list_clear_spec.rb +28 -34
  1128. data/spec/unit/knife/role_run_list_remove_spec.rb +36 -42
  1129. data/spec/unit/knife/role_run_list_replace_spec.rb +42 -45
  1130. data/spec/unit/knife/role_run_list_set_spec.rb +6 -9
  1131. data/spec/unit/knife/role_show_spec.rb +14 -14
  1132. data/spec/unit/knife/ssh_spec.rb +36 -36
  1133. data/spec/unit/knife/ssl_check_spec.rb +7 -7
  1134. data/spec/unit/knife/ssl_fetch_spec.rb +8 -8
  1135. data/spec/unit/knife/status_spec.rb +5 -5
  1136. data/spec/unit/knife/tag_create_spec.rb +1 -1
  1137. data/spec/unit/knife/tag_delete_spec.rb +1 -1
  1138. data/spec/unit/knife/tag_list_spec.rb +2 -2
  1139. data/spec/unit/knife/user_create_spec.rb +30 -30
  1140. data/spec/unit/knife/user_delete_spec.rb +11 -11
  1141. data/spec/unit/knife/user_edit_spec.rb +9 -9
  1142. data/spec/unit/knife/user_list_spec.rb +3 -3
  1143. data/spec/unit/knife/user_reregister_spec.rb +13 -13
  1144. data/spec/unit/knife/user_show_spec.rb +12 -12
  1145. data/spec/unit/knife_spec.rb +61 -61
  1146. data/spec/unit/lib_backcompat_spec.rb +34 -0
  1147. data/spec/unit/log/syslog_spec.rb +3 -3
  1148. data/spec/unit/log/winevt_spec.rb +3 -3
  1149. data/spec/unit/log_spec.rb +5 -5
  1150. data/spec/unit/lwrp_spec.rb +41 -43
  1151. data/spec/unit/mash_spec.rb +8 -8
  1152. data/spec/unit/mixin/api_version_request_handling_spec.rb +13 -14
  1153. data/spec/unit/mixin/checksum_spec.rb +5 -6
  1154. data/spec/unit/mixin/command_spec.rb +9 -9
  1155. data/spec/unit/mixin/convert_to_class_name_spec.rb +2 -2
  1156. data/spec/unit/mixin/deep_merge_spec.rb +107 -107
  1157. data/spec/unit/mixin/deprecation_spec.rb +5 -5
  1158. data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +9 -9
  1159. data/spec/unit/mixin/homebrew_user_spec.rb +13 -13
  1160. data/spec/unit/mixin/params_validate_spec.rb +71 -71
  1161. data/spec/unit/mixin/path_sanity_spec.rb +16 -16
  1162. data/spec/unit/mixin/powershell_out_spec.rb +9 -9
  1163. data/spec/unit/mixin/powershell_type_coercions_spec.rb +34 -23
  1164. data/spec/unit/mixin/properties_spec.rb +27 -27
  1165. data/spec/unit/mixin/proxified_socket_spec.rb +6 -6
  1166. data/spec/unit/mixin/securable_spec.rb +37 -37
  1167. data/spec/unit/mixin/shell_out_spec.rb +68 -68
  1168. data/spec/unit/mixin/subclass_directive_spec.rb +2 -2
  1169. data/spec/unit/mixin/template_spec.rb +15 -12
  1170. data/spec/unit/mixin/unformatter_spec.rb +3 -3
  1171. data/spec/unit/mixin/uris_spec.rb +8 -8
  1172. data/spec/unit/mixin/windows_architecture_helper_spec.rb +14 -17
  1173. data/spec/unit/mixin/xml_escape_spec.rb +3 -3
  1174. data/spec/unit/monkey_patches/uri_spec.rb +3 -3
  1175. data/spec/unit/monologger_spec.rb +4 -4
  1176. data/spec/unit/node/attribute_spec.rb +203 -248
  1177. data/spec/unit/node/immutable_collections_spec.rb +20 -21
  1178. data/spec/unit/node_map_spec.rb +5 -5
  1179. data/spec/unit/node_spec.rb +165 -135
  1180. data/spec/unit/org_spec.rb +17 -17
  1181. data/spec/unit/platform/query_helpers_spec.rb +23 -23
  1182. data/spec/unit/platform_spec.rb +17 -17
  1183. data/spec/unit/policy_builder/dynamic_spec.rb +8 -10
  1184. data/spec/unit/policy_builder/expand_node_object_spec.rb +16 -14
  1185. data/spec/unit/policy_builder/policyfile_spec.rb +30 -37
  1186. data/spec/unit/policy_builder_spec.rb +4 -4
  1187. data/spec/unit/property/state_spec.rb +58 -56
  1188. data/spec/unit/property/validation_spec.rb +255 -216
  1189. data/spec/unit/property_spec.rb +206 -129
  1190. data/spec/unit/provider/apt_update_spec.rb +113 -0
  1191. data/spec/unit/provider/breakpoint_spec.rb +2 -3
  1192. data/spec/unit/provider/cookbook_file/content_spec.rb +9 -10
  1193. data/spec/unit/provider/cookbook_file_spec.rb +11 -11
  1194. data/spec/unit/provider/cron/unix_spec.rb +7 -7
  1195. data/spec/unit/provider/cron_spec.rb +67 -67
  1196. data/spec/unit/provider/deploy/revision_spec.rb +6 -7
  1197. data/spec/unit/provider/deploy/timestamped_spec.rb +2 -2
  1198. data/spec/unit/provider/deploy_spec.rb +24 -25
  1199. data/spec/unit/provider/directory_spec.rb +12 -12
  1200. data/spec/unit/provider/dsc_resource_spec.rb +29 -27
  1201. data/spec/unit/provider/dsc_script_spec.rb +47 -48
  1202. data/spec/unit/provider/env/windows_spec.rb +21 -21
  1203. data/spec/unit/provider/env_spec.rb +5 -5
  1204. data/spec/unit/provider/erl_call_spec.rb +3 -4
  1205. data/spec/unit/provider/execute_spec.rb +5 -5
  1206. data/spec/unit/provider/file/content_spec.rb +4 -4
  1207. data/spec/unit/provider/file_spec.rb +8 -9
  1208. data/spec/unit/provider/git_spec.rb +64 -65
  1209. data/spec/unit/provider/group/dscl_spec.rb +7 -7
  1210. data/spec/unit/provider/group/gpasswd_spec.rb +3 -3
  1211. data/spec/unit/provider/group/groupadd_spec.rb +9 -9
  1212. data/spec/unit/provider/group/groupmod_spec.rb +12 -12
  1213. data/spec/unit/provider/group/pw_spec.rb +3 -3
  1214. data/spec/unit/provider/group/usermod_spec.rb +6 -6
  1215. data/spec/unit/provider/group/windows_spec.rb +3 -3
  1216. data/spec/unit/provider/group_spec.rb +16 -16
  1217. data/spec/unit/provider/http_request_spec.rb +7 -7
  1218. data/spec/unit/provider/ifconfig/aix_spec.rb +4 -5
  1219. data/spec/unit/provider/ifconfig/debian_spec.rb +6 -6
  1220. data/spec/unit/provider/ifconfig/redhat_spec.rb +3 -3
  1221. data/spec/unit/provider/ifconfig_spec.rb +5 -5
  1222. data/spec/unit/provider/link_spec.rb +12 -12
  1223. data/spec/unit/provider/log_spec.rb +2 -2
  1224. data/spec/unit/provider/mdadm_spec.rb +12 -12
  1225. data/spec/unit/provider/mount/aix_spec.rb +7 -7
  1226. data/spec/unit/provider/mount/mount_spec.rb +20 -20
  1227. data/spec/unit/provider/mount/solaris_spec.rb +26 -26
  1228. data/spec/unit/provider/mount/windows_spec.rb +8 -8
  1229. data/spec/unit/provider/mount_spec.rb +7 -8
  1230. data/spec/unit/provider/ohai_spec.rb +13 -13
  1231. data/spec/unit/provider/osx_profile_spec.rb +249 -0
  1232. data/spec/unit/provider/package/aix_spec.rb +5 -5
  1233. data/spec/unit/provider/package/apt_spec.rb +49 -49
  1234. data/spec/unit/provider/package/chocolatey_spec.rb +504 -0
  1235. data/spec/unit/provider/package/dpkg_spec.rb +32 -36
  1236. data/spec/unit/provider/package/easy_install_spec.rb +11 -15
  1237. data/spec/unit/provider/package/freebsd/pkg_spec.rb +10 -10
  1238. data/spec/unit/provider/package/freebsd/pkgng_spec.rb +12 -19
  1239. data/spec/unit/provider/package/freebsd/port_spec.rb +12 -19
  1240. data/spec/unit/provider/package/homebrew_spec.rb +139 -139
  1241. data/spec/unit/provider/package/ips_spec.rb +10 -11
  1242. data/spec/unit/provider/package/macports_spec.rb +3 -3
  1243. data/spec/unit/provider/package/openbsd_spec.rb +38 -38
  1244. data/spec/unit/provider/package/pacman_spec.rb +8 -9
  1245. data/spec/unit/provider/package/paludis_spec.rb +9 -10
  1246. data/spec/unit/provider/package/portage_spec.rb +2 -2
  1247. data/spec/unit/provider/package/rpm_spec.rb +7 -11
  1248. data/spec/unit/provider/package/rubygems_spec.rb +386 -289
  1249. data/spec/unit/provider/package/smartos_spec.rb +8 -10
  1250. data/spec/unit/provider/package/solaris_spec.rb +4 -4
  1251. data/spec/unit/provider/package/windows/exe_spec.rb +17 -81
  1252. data/spec/unit/provider/package/windows/msi_spec.rb +16 -16
  1253. data/spec/unit/provider/package/windows_spec.rb +50 -40
  1254. data/spec/unit/provider/package/yum_spec.rb +179 -181
  1255. data/spec/unit/provider/package/zypper_spec.rb +53 -50
  1256. data/spec/unit/provider/package_spec.rb +104 -104
  1257. data/spec/unit/provider/powershell_script_spec.rb +20 -20
  1258. data/spec/unit/provider/registry_key_spec.rb +3 -3
  1259. data/spec/unit/provider/remote_directory_spec.rb +46 -46
  1260. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +9 -10
  1261. data/spec/unit/provider/remote_file/content_spec.rb +5 -6
  1262. data/spec/unit/provider/remote_file/fetcher_spec.rb +3 -3
  1263. data/spec/unit/provider/remote_file/ftp_spec.rb +3 -3
  1264. data/spec/unit/provider/remote_file/http_spec.rb +10 -12
  1265. data/spec/unit/provider/remote_file/local_file_spec.rb +2 -2
  1266. data/spec/unit/provider/remote_file/network_file_spec.rb +2 -2
  1267. data/spec/unit/provider/remote_file_spec.rb +9 -11
  1268. data/spec/unit/provider/route_spec.rb +26 -27
  1269. data/spec/unit/provider/ruby_block_spec.rb +4 -5
  1270. data/spec/unit/provider/script_spec.rb +11 -11
  1271. data/spec/unit/provider/service/aix_service_spec.rb +5 -6
  1272. data/spec/unit/provider/service/aixinit_service_spec.rb +26 -23
  1273. data/spec/unit/provider/service/arch_service_spec.rb +15 -15
  1274. data/spec/unit/provider/service/debian_service_spec.rb +37 -37
  1275. data/spec/unit/provider/service/freebsd_service_spec.rb +9 -9
  1276. data/spec/unit/provider/service/gentoo_service_spec.rb +4 -4
  1277. data/spec/unit/provider/service/init_service_spec.rb +9 -9
  1278. data/spec/unit/provider/service/insserv_service_spec.rb +3 -3
  1279. data/spec/unit/provider/service/invokercd_service_spec.rb +9 -9
  1280. data/spec/unit/provider/service/macosx_spec.rb +26 -26
  1281. data/spec/unit/provider/service/openbsd_service_spec.rb +26 -26
  1282. data/spec/unit/provider/service/redhat_spec.rb +16 -16
  1283. data/spec/unit/provider/service/simple_service_spec.rb +5 -5
  1284. data/spec/unit/provider/service/solaris_smf_service_spec.rb +51 -51
  1285. data/spec/unit/provider/service/systemd_service_spec.rb +4 -4
  1286. data/spec/unit/provider/service/upstart_service_spec.rb +13 -13
  1287. data/spec/unit/provider/service/windows_spec.rb +28 -37
  1288. data/spec/unit/provider/service_spec.rb +2 -3
  1289. data/spec/unit/provider/subversion_spec.rb +27 -28
  1290. data/spec/unit/provider/template/content_spec.rb +21 -21
  1291. data/spec/unit/provider/template_spec.rb +15 -16
  1292. data/spec/unit/provider/user/dscl_spec.rb +36 -37
  1293. data/spec/unit/provider/user/pw_spec.rb +12 -12
  1294. data/spec/unit/provider/user/solaris_spec.rb +31 -31
  1295. data/spec/unit/provider/user/useradd_spec.rb +10 -10
  1296. data/spec/unit/provider/user/windows_spec.rb +9 -9
  1297. data/spec/unit/provider/user_spec.rb +19 -20
  1298. data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +3 -4
  1299. data/spec/unit/provider_resolver_spec.rb +63 -62
  1300. data/spec/unit/provider_spec.rb +7 -8
  1301. data/spec/unit/pure_application_spec.rb +3 -3
  1302. data/spec/unit/recipe_spec.rb +13 -16
  1303. data/spec/unit/resource/apt_package_spec.rb +4 -4
  1304. data/spec/unit/resource/apt_update_spec.rb +38 -0
  1305. data/spec/unit/resource/bash_spec.rb +3 -3
  1306. data/spec/unit/resource/batch_spec.rb +5 -5
  1307. data/spec/unit/resource/breakpoint_spec.rb +3 -3
  1308. data/spec/unit/resource/chef_gem_spec.rb +5 -9
  1309. data/spec/unit/resource/chocolatey_package_spec.rb +67 -0
  1310. data/spec/unit/resource/conditional_action_not_nothing_spec.rb +2 -2
  1311. data/spec/unit/resource/conditional_spec.rb +12 -12
  1312. data/spec/unit/resource/cookbook_file_spec.rb +23 -24
  1313. data/spec/unit/resource/cron_spec.rb +4 -4
  1314. data/spec/unit/resource/csh_spec.rb +3 -3
  1315. data/spec/unit/resource/deploy_revision_spec.rb +3 -3
  1316. data/spec/unit/resource/deploy_spec.rb +23 -24
  1317. data/spec/unit/resource/directory_spec.rb +4 -4
  1318. data/spec/unit/resource/dpkg_package_spec.rb +5 -5
  1319. data/spec/unit/resource/dsc_resource_spec.rb +11 -11
  1320. data/spec/unit/resource/dsc_script_spec.rb +15 -15
  1321. data/spec/unit/resource/easy_install_package_spec.rb +3 -3
  1322. data/spec/unit/resource/env_spec.rb +5 -5
  1323. data/spec/unit/resource/erl_call_spec.rb +3 -3
  1324. data/spec/unit/resource/execute_spec.rb +4 -4
  1325. data/spec/unit/resource/file/verification_spec.rb +11 -11
  1326. data/spec/unit/resource/file_spec.rb +10 -10
  1327. data/spec/unit/resource/freebsd_package_spec.rb +6 -9
  1328. data/spec/unit/resource/gem_package_spec.rb +4 -4
  1329. data/spec/unit/resource/git_spec.rb +3 -3
  1330. data/spec/unit/resource/group_spec.rb +4 -4
  1331. data/spec/unit/resource/homebrew_package_spec.rb +13 -13
  1332. data/spec/unit/resource/http_request_spec.rb +5 -5
  1333. data/spec/unit/resource/ifconfig_spec.rb +9 -9
  1334. data/spec/unit/resource/ips_package_spec.rb +4 -4
  1335. data/spec/unit/resource/ksh_spec.rb +2 -2
  1336. data/spec/unit/resource/link_spec.rb +6 -6
  1337. data/spec/unit/resource/log_spec.rb +3 -3
  1338. data/spec/unit/resource/macports_package_spec.rb +3 -3
  1339. data/spec/unit/resource/mdadm_spec.rb +3 -3
  1340. data/spec/unit/resource/mount_spec.rb +7 -7
  1341. data/spec/unit/resource/ohai_spec.rb +2 -3
  1342. data/spec/unit/resource/openbsd_package_spec.rb +5 -6
  1343. data/spec/unit/resource/osx_profile_spec.rb +61 -0
  1344. data/spec/unit/resource/package_spec.rb +6 -6
  1345. data/spec/unit/resource/pacman_package_spec.rb +3 -3
  1346. data/spec/unit/resource/perl_spec.rb +3 -3
  1347. data/spec/unit/resource/portage_package_spec.rb +2 -2
  1348. data/spec/unit/resource/powershell_script_spec.rb +16 -16
  1349. data/spec/unit/resource/python_spec.rb +3 -3
  1350. data/spec/unit/resource/registry_key_spec.rb +21 -21
  1351. data/spec/unit/resource/remote_directory_spec.rb +3 -3
  1352. data/spec/unit/resource/remote_file_spec.rb +15 -15
  1353. data/spec/unit/resource/resource_notification_spec.rb +18 -18
  1354. data/spec/unit/resource/route_spec.rb +3 -3
  1355. data/spec/unit/resource/rpm_package_spec.rb +4 -4
  1356. data/spec/unit/resource/ruby_block_spec.rb +4 -4
  1357. data/spec/unit/resource/ruby_spec.rb +3 -3
  1358. data/spec/unit/resource/scm_spec.rb +8 -8
  1359. data/spec/unit/resource/script_spec.rb +4 -4
  1360. data/spec/unit/resource/service_spec.rb +4 -5
  1361. data/spec/unit/resource/smartos_package_spec.rb +3 -3
  1362. data/spec/unit/resource/solaris_package_spec.rb +3 -3
  1363. data/spec/unit/resource/subversion_spec.rb +5 -5
  1364. data/spec/unit/resource/template_spec.rb +7 -8
  1365. data/spec/unit/resource/timestamped_deploy_spec.rb +4 -4
  1366. data/spec/unit/resource/user_spec.rb +4 -4
  1367. data/spec/unit/resource/windows_package_spec.rb +7 -7
  1368. data/spec/unit/resource/windows_service_spec.rb +3 -3
  1369. data/spec/unit/resource/yum_package_spec.rb +6 -6
  1370. data/spec/unit/resource_collection/resource_list_spec.rb +7 -7
  1371. data/spec/unit/resource_collection/resource_set_spec.rb +9 -9
  1372. data/spec/unit/resource_collection/stepable_iterator_spec.rb +6 -6
  1373. data/spec/unit/resource_collection_spec.rb +8 -9
  1374. data/spec/unit/resource_definition_spec.rb +3 -3
  1375. data/spec/unit/resource_reporter_spec.rb +56 -64
  1376. data/spec/unit/resource_resolver_spec.rb +5 -6
  1377. data/spec/unit/resource_spec.rb +80 -60
  1378. data/spec/unit/rest/auth_credentials_spec.rb +39 -71
  1379. data/spec/unit/rest_spec.rb +96 -90
  1380. data/spec/unit/role_spec.rb +64 -68
  1381. data/spec/unit/run_context/child_run_context_spec.rb +23 -23
  1382. data/spec/unit/run_context/cookbook_compiler_spec.rb +5 -7
  1383. data/spec/unit/run_context_spec.rb +19 -19
  1384. data/spec/unit/run_list/run_list_expansion_spec.rb +24 -24
  1385. data/spec/unit/run_list/run_list_item_spec.rb +28 -28
  1386. data/spec/unit/run_list/versioned_recipe_list_spec.rb +22 -23
  1387. data/spec/unit/run_list_spec.rb +37 -41
  1388. data/spec/unit/run_lock_spec.rb +10 -10
  1389. data/spec/unit/run_status_spec.rb +4 -5
  1390. data/spec/unit/runner_spec.rb +8 -8
  1391. data/spec/unit/scan_access_control_spec.rb +4 -5
  1392. data/spec/unit/search/query_spec.rb +50 -46
  1393. data/spec/unit/shell/model_wrapper_spec.rb +12 -13
  1394. data/spec/unit/shell/shell_ext_spec.rb +5 -5
  1395. data/spec/unit/shell/shell_session_spec.rb +8 -9
  1396. data/spec/unit/shell_out_spec.rb +1 -1
  1397. data/spec/unit/shell_spec.rb +9 -9
  1398. data/spec/unit/user_spec.rb +14 -15
  1399. data/spec/unit/user_v1_spec.rb +22 -23
  1400. data/spec/unit/util/backup_spec.rb +17 -18
  1401. data/spec/unit/util/diff_spec.rb +6 -9
  1402. data/spec/unit/util/dsc/configuration_generator_spec.rb +48 -48
  1403. data/spec/unit/util/dsc/lcm_output_parser_spec.rb +22 -22
  1404. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +30 -31
  1405. data/spec/unit/util/dsc/resource_store.rb +22 -22
  1406. data/spec/unit/util/editor_spec.rb +65 -65
  1407. data/spec/unit/util/file_edit_spec.rb +7 -7
  1408. data/spec/unit/util/powershell/cmdlet_spec.rb +27 -27
  1409. data/spec/unit/util/powershell/ps_credential_spec.rb +13 -13
  1410. data/spec/unit/util/selinux_spec.rb +8 -9
  1411. data/spec/unit/util/threaded_job_queue_spec.rb +2 -2
  1412. data/spec/unit/version/platform_spec.rb +5 -6
  1413. data/spec/unit/version_class_spec.rb +8 -9
  1414. data/spec/unit/version_constraint/platform_spec.rb +3 -4
  1415. data/spec/unit/version_constraint_spec.rb +19 -19
  1416. data/spec/unit/win32/registry_spec.rb +25 -25
  1417. data/spec/unit/windows_service_spec.rb +20 -20
  1418. data/tasks/cbgb.rb +84 -0
  1419. data/tasks/external_tests.rb +12 -11
  1420. data/tasks/maintainers.rb +15 -15
  1421. data/tasks/rspec.rb +18 -15
  1422. metadata +250 -67
  1423. data/lib/chef/chef_fs/file_system/acl_dir.rb +0 -63
  1424. data/lib/chef/chef_fs/file_system/acl_entry.rb +0 -58
  1425. data/lib/chef/chef_fs/file_system/acls_dir.rb +0 -72
  1426. data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_dir.rb +0 -102
  1427. data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbook_entry.rb +0 -80
  1428. data/lib/chef/chef_fs/file_system/chef_repository_file_system_cookbooks_dir.rb +0 -82
  1429. data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +0 -81
  1430. data/lib/chef/chef_fs/file_system/chef_repository_file_system_root_dir.rb +0 -196
  1431. data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +0 -165
  1432. data/lib/chef/chef_fs/file_system/cookbook_dir.rb +0 -224
  1433. data/lib/chef/chef_fs/file_system/cookbook_file.rb +0 -82
  1434. data/lib/chef/chef_fs/file_system/cookbook_subdir.rb +0 -59
  1435. data/lib/chef/chef_fs/file_system/cookbooks_acl_dir.rb +0 -41
  1436. data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +0 -156
  1437. data/lib/chef/chef_fs/file_system/data_bag_dir.rb +0 -69
  1438. data/lib/chef/chef_fs/file_system/data_bags_dir.rb +0 -71
  1439. data/lib/chef/chef_fs/file_system/environments_dir.rb +0 -60
  1440. data/lib/chef/chef_fs/file_system/file_system_entry.rb +0 -115
  1441. data/lib/chef/chef_fs/file_system/memory_dir.rb +0 -51
  1442. data/lib/chef/chef_fs/file_system/memory_file.rb +0 -17
  1443. data/lib/chef/chef_fs/file_system/memory_root.rb +0 -21
  1444. data/lib/chef/chef_fs/file_system/nodes_dir.rb +0 -55
  1445. data/lib/chef/chef_fs/file_system/org_entry.rb +0 -34
  1446. data/lib/chef/chef_fs/file_system/organization_invites_entry.rb +0 -59
  1447. data/lib/chef/chef_fs/file_system/organization_members_entry.rb +0 -58
  1448. data/lib/chef/chef_fs/file_system/rest_list_dir.rb +0 -110
  1449. data/lib/chef/chef_fs/file_system/rest_list_entry.rb +0 -185
@@ -1,6 +1,6 @@
1
1
  #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
2
+ # Author:: Adam Jacob (<adam@chef.io>)
3
+ # Copyright:: Copyright 2008-2016, Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require 'spec_helper'
19
+ require "spec_helper"
20
20
 
21
21
  describe Chef::Provider::Package::Zypper do
22
22
  let!(:new_resource) { Chef::Resource::ZypperPackage.new("cups") }
@@ -34,16 +34,16 @@ describe Chef::Provider::Package::Zypper do
34
34
 
35
35
  before(:each) do
36
36
  allow(Chef::Resource::Package).to receive(:new).and_return(current_resource)
37
- allow(provider).to receive(:shell_out).and_return(status)
37
+ allow(provider).to receive(:shell_out!).and_return(status)
38
38
  allow(provider).to receive(:`).and_return("2.0")
39
39
  end
40
40
 
41
- def shell_out_expectation(command, options=nil)
41
+ def shell_out_expectation(command, options = nil)
42
42
  options ||= { timeout: 900 }
43
43
  expect(provider).to receive(:shell_out).with(command, options)
44
44
  end
45
45
 
46
- def shell_out_expectation!(command, options=nil)
46
+ def shell_out_expectation!(command, options = nil)
47
47
  options ||= { timeout: 900 }
48
48
  expect(provider).to receive(:shell_out!).with(command, options)
49
49
  end
@@ -60,7 +60,7 @@ describe Chef::Provider::Package::Zypper do
60
60
  end
61
61
 
62
62
  it "should run zypper info with the package name" do
63
- shell_out_expectation(
63
+ shell_out_expectation!(
64
64
  "zypper --non-interactive info #{new_resource.package_name}"
65
65
  ).and_return(status)
66
66
  provider.load_current_resource
@@ -68,34 +68,24 @@ describe Chef::Provider::Package::Zypper do
68
68
 
69
69
  it "should set the installed version to nil on the current resource if zypper info installed version is (none)" do
70
70
  allow(provider).to receive(:shell_out).and_return(status)
71
- expect(current_resource).to receive(:version).with(nil).and_return(true)
71
+ expect(current_resource).to receive(:version).with([nil]).and_return(true)
72
72
  provider.load_current_resource
73
73
  end
74
74
 
75
75
  it "should set the installed version if zypper info has one" do
76
76
  status = double(:stdout => "Version: 1.0\nInstalled: Yes\n", :exitstatus => 0)
77
77
 
78
- allow(provider).to receive(:shell_out).and_return(status)
79
- expect(current_resource).to receive(:version).with("1.0").and_return(true)
78
+ allow(provider).to receive(:shell_out!).and_return(status)
79
+ expect(current_resource).to receive(:version).with(["1.0"]).and_return(true)
80
80
  provider.load_current_resource
81
81
  end
82
82
 
83
83
  it "should set the candidate version if zypper info has one" do
84
84
  status = double(:stdout => "Version: 1.0\nInstalled: No\nStatus: out-of-date (version 0.9 installed)", :exitstatus => 0)
85
85
 
86
- allow(provider).to receive(:shell_out).and_return(status)
86
+ allow(provider).to receive(:shell_out!).and_return(status)
87
87
  provider.load_current_resource
88
- expect(provider.candidate_version).to eql("1.0")
89
- end
90
-
91
- it "should raise an exception if zypper info fails" do
92
- expect(status).to receive(:exitstatus).and_return(1)
93
- expect { provider.load_current_resource }.to raise_error(Chef::Exceptions::Package)
94
- end
95
-
96
- it "should not raise an exception if zypper info succeeds" do
97
- expect(status).to receive(:exitstatus).and_return(0)
98
- expect { provider.load_current_resource }.not_to raise_error
88
+ expect(provider.candidate_version).to eql(["1.0"])
99
89
  end
100
90
 
101
91
  it "should return the current resouce" do
@@ -109,25 +99,23 @@ describe Chef::Provider::Package::Zypper do
109
99
  shell_out_expectation!(
110
100
  "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0"
111
101
  )
112
- provider.install_package("emacs", "1.0")
102
+ provider.install_package(["emacs"], ["1.0"])
113
103
  end
114
104
  it "should run zypper install without gpg checks" do
115
105
  allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
116
106
  shell_out_expectation!(
117
- "zypper --non-interactive --no-gpg-checks install "+
118
- "--auto-agree-with-licenses emacs=1.0"
107
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0"
119
108
  )
120
- provider.install_package("emacs", "1.0")
109
+ provider.install_package(["emacs"], ["1.0"])
121
110
  end
122
111
  it "should warn about gpg checks on zypper install" do
123
112
  expect(Chef::Log).to receive(:warn).with(
124
113
  /All packages will be installed without gpg signature checks/
125
114
  )
126
115
  shell_out_expectation!(
127
- "zypper --non-interactive --no-gpg-checks install "+
128
- "--auto-agree-with-licenses emacs=1.0"
116
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0"
129
117
  )
130
- provider.install_package("emacs", "1.0")
118
+ provider.install_package(["emacs"], ["1.0"])
131
119
  end
132
120
  end
133
121
 
@@ -137,32 +125,29 @@ describe Chef::Provider::Package::Zypper do
137
125
  shell_out_expectation!(
138
126
  "zypper --non-interactive install --auto-agree-with-licenses emacs=1.0"
139
127
  )
140
- provider.upgrade_package("emacs", "1.0")
128
+ provider.upgrade_package(["emacs"], ["1.0"])
141
129
  end
142
130
  it "should run zypper update without gpg checks" do
143
131
  allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
144
132
  shell_out_expectation!(
145
- "zypper --non-interactive --no-gpg-checks install "+
146
- "--auto-agree-with-licenses emacs=1.0"
133
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0"
147
134
  )
148
- provider.upgrade_package("emacs", "1.0")
135
+ provider.upgrade_package(["emacs"], ["1.0"])
149
136
  end
150
137
  it "should warn about gpg checks on zypper upgrade" do
151
138
  expect(Chef::Log).to receive(:warn).with(
152
139
  /All packages will be installed without gpg signature checks/
153
140
  )
154
141
  shell_out_expectation!(
155
- "zypper --non-interactive --no-gpg-checks install "+
156
- "--auto-agree-with-licenses emacs=1.0"
142
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0"
157
143
  )
158
- provider.upgrade_package("emacs", "1.0")
144
+ provider.upgrade_package(["emacs"], ["1.0"])
159
145
  end
160
146
  it "should run zypper upgrade without gpg checks" do
161
147
  shell_out_expectation!(
162
- "zypper --non-interactive --no-gpg-checks install "+
163
- "--auto-agree-with-licenses emacs=1.0"
148
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0"
164
149
  )
165
- provider.upgrade_package("emacs", "1.0")
150
+ provider.upgrade_package(["emacs"], ["1.0"])
166
151
  end
167
152
  end
168
153
 
@@ -174,7 +159,7 @@ describe Chef::Provider::Package::Zypper do
174
159
  shell_out_expectation!(
175
160
  "zypper --non-interactive remove emacs"
176
161
  )
177
- provider.remove_package("emacs", nil)
162
+ provider.remove_package(["emacs"], [nil])
178
163
  end
179
164
  end
180
165
 
@@ -184,14 +169,14 @@ describe Chef::Provider::Package::Zypper do
184
169
  shell_out_expectation!(
185
170
  "zypper --non-interactive remove emacs=1.0"
186
171
  )
187
- provider.remove_package("emacs", "1.0")
172
+ provider.remove_package(["emacs"], ["1.0"])
188
173
  end
189
174
  it "should run zypper remove without gpg checks" do
190
175
  allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
191
176
  shell_out_expectation!(
192
177
  "zypper --non-interactive --no-gpg-checks remove emacs=1.0"
193
178
  )
194
- provider.remove_package("emacs", "1.0")
179
+ provider.remove_package(["emacs"], ["1.0"])
195
180
  end
196
181
  it "should warn about gpg checks on zypper remove" do
197
182
  expect(Chef::Log).to receive(:warn).with(
@@ -200,24 +185,24 @@ describe Chef::Provider::Package::Zypper do
200
185
  shell_out_expectation!(
201
186
  "zypper --non-interactive --no-gpg-checks remove emacs=1.0"
202
187
  )
203
- provider.remove_package("emacs", "1.0")
188
+ provider.remove_package(["emacs"], ["1.0"])
204
189
  end
205
190
  end
206
191
  end
207
192
 
208
193
  describe "purge_package" do
209
- it "should run remove_package with the name and version" do
194
+ it "should run remove with the name and version and --clean-deps" do
210
195
  shell_out_expectation!(
211
196
  "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0"
212
197
  )
213
- provider.purge_package("emacs", "1.0")
198
+ provider.purge_package(["emacs"], ["1.0"])
214
199
  end
215
200
  it "should run zypper purge without gpg checks" do
216
201
  allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
217
202
  shell_out_expectation!(
218
203
  "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0"
219
204
  )
220
- provider.purge_package("emacs", "1.0")
205
+ provider.purge_package(["emacs"], ["1.0"])
221
206
  end
222
207
  it "should warn about gpg checks on zypper purge" do
223
208
  expect(Chef::Log).to receive(:warn).with(
@@ -226,7 +211,7 @@ describe Chef::Provider::Package::Zypper do
226
211
  shell_out_expectation!(
227
212
  "zypper --non-interactive --no-gpg-checks remove --clean-deps emacs=1.0"
228
213
  )
229
- provider.purge_package("emacs", "1.0")
214
+ provider.purge_package(["emacs"], ["1.0"])
230
215
  end
231
216
  end
232
217
 
@@ -240,7 +225,7 @@ describe Chef::Provider::Package::Zypper do
240
225
  shell_out_expectation!(
241
226
  "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs"
242
227
  )
243
- provider.install_package("emacs", "1.0")
228
+ provider.install_package(["emacs"], ["1.0"])
244
229
  end
245
230
  end
246
231
 
@@ -249,7 +234,7 @@ describe Chef::Provider::Package::Zypper do
249
234
  shell_out_expectation!(
250
235
  "zypper --no-gpg-checks install --auto-agree-with-licenses -y emacs"
251
236
  )
252
- provider.upgrade_package("emacs", "1.0")
237
+ provider.upgrade_package(["emacs"], ["1.0"])
253
238
  end
254
239
  end
255
240
 
@@ -258,8 +243,26 @@ describe Chef::Provider::Package::Zypper do
258
243
  shell_out_expectation!(
259
244
  "zypper --no-gpg-checks remove -y emacs"
260
245
  )
261
- provider.remove_package("emacs", "1.0")
246
+ provider.remove_package(["emacs"], ["1.0"])
262
247
  end
263
248
  end
264
249
  end
250
+
251
+ describe "when installing multiple packages" do # https://github.com/chef/chef/issues/3570
252
+ it "should install an array of package names and versions" do
253
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
254
+ shell_out_expectation!(
255
+ "zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0 vim=2.0"
256
+ )
257
+ provider.install_package(["emacs", "vim"], ["1.0", "2.0"])
258
+ end
259
+
260
+ it "should remove an array of package names and versions" do
261
+ allow(Chef::Config).to receive(:[]).with(:zypper_check_gpg).and_return(false)
262
+ shell_out_expectation!(
263
+ "zypper --non-interactive --no-gpg-checks remove emacs=1.0 vim=2.0"
264
+ )
265
+ provider.remove_package(["emacs", "vim"], ["1.0", "2.0"])
266
+ end
267
+ end
265
268
  end
@@ -1,6 +1,6 @@
1
1
  #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Copyright:: Copyright (c) 2008-2015 Chef Software, Inc.
2
+ # Author:: Adam Jacob (<adam@chef.io>)
3
+ # Copyright:: Copyright 2008-2016, Chef Software, Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,7 +16,7 @@
16
16
  # limitations under the License.
17
17
  #
18
18
 
19
- require 'spec_helper'
19
+ require "spec_helper"
20
20
 
21
21
  describe Chef::Provider::Package do
22
22
  let(:node) do
@@ -27,8 +27,8 @@ describe Chef::Provider::Package do
27
27
  end
28
28
  let(:events) { Chef::EventDispatch::Dispatcher.new }
29
29
  let(:run_context) { Chef::RunContext.new(node, {}, events) }
30
- let(:new_resource) { Chef::Resource::Package.new('emacs') }
31
- let(:current_resource) { Chef::Resource::Package.new('emacs') }
30
+ let(:new_resource) { Chef::Resource::Package.new("emacs") }
31
+ let(:current_resource) { Chef::Resource::Package.new("emacs") }
32
32
  let(:candidate_version) { "1.0" }
33
33
  let(:provider) do
34
34
  provider = Chef::Provider::Package.new(new_resource, run_context)
@@ -44,8 +44,8 @@ describe Chef::Provider::Package do
44
44
  end
45
45
 
46
46
  it "raises a Chef::Exceptions::InvalidResourceSpecification if both multipackage and source are provided" do
47
- new_resource.package_name(['a', 'b'])
48
- new_resource.source('foo')
47
+ new_resource.package_name(["a", "b"])
48
+ new_resource.source("foo")
49
49
  expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
50
50
  end
51
51
 
@@ -58,7 +58,7 @@ describe Chef::Provider::Package do
58
58
  new_resource.response_file("foo")
59
59
  expect(provider).to receive(:get_preseed_file).with(
60
60
  new_resource.name,
61
- provider.candidate_version
61
+ provider.candidate_version,
62
62
  ).and_return("/var/cache/preseed-test")
63
63
 
64
64
  expect(provider).to receive(:preseed_package).with(
@@ -75,7 +75,7 @@ describe Chef::Provider::Package do
75
75
  it "should install the package at the candidate_version if it is not already installed" do
76
76
  expect(provider).to receive(:install_package).with(
77
77
  new_resource.name,
78
- provider.candidate_version
78
+ provider.candidate_version,
79
79
  ).and_return(true)
80
80
  provider.run_action(:install)
81
81
  expect(new_resource).to be_updated_by_last_action
@@ -85,7 +85,7 @@ describe Chef::Provider::Package do
85
85
  new_resource.version("1.0")
86
86
  expect(provider).to receive(:install_package).with(
87
87
  new_resource.name,
88
- new_resource.version
88
+ new_resource.version,
89
89
  ).and_return(true)
90
90
  provider.run_action(:install)
91
91
  expect(new_resource).to be_updated_by_last_action
@@ -96,7 +96,7 @@ describe Chef::Provider::Package do
96
96
  allow(current_resource).to receive(:version).and_return("0.99")
97
97
  expect(provider).to receive(:install_package).with(
98
98
  new_resource.name,
99
- new_resource.version
99
+ new_resource.version,
100
100
  ).and_return(true)
101
101
  provider.run_action(:install)
102
102
  expect(new_resource).to be_updated_by_last_action
@@ -144,7 +144,7 @@ describe Chef::Provider::Package do
144
144
  it "should upgrade the package if the current version is not the candidate version" do
145
145
  expect(provider).to receive(:upgrade_package).with(
146
146
  new_resource.name,
147
- provider.candidate_version
147
+ provider.candidate_version,
148
148
  ).and_return(true)
149
149
  provider.run_action(:upgrade)
150
150
  expect(new_resource).to be_updated_by_last_action
@@ -187,12 +187,12 @@ describe Chef::Provider::Package do
187
187
  describe "When removing the package" do
188
188
  before(:each) do
189
189
  allow(provider).to receive(:remove_package).and_return(true)
190
- current_resource.version '1.4.2'
190
+ current_resource.version "1.4.2"
191
191
  end
192
192
 
193
193
  it "should remove the package if it is installed" do
194
194
  expect(provider).to be_removing_package
195
- expect(provider).to receive(:remove_package).with('emacs', nil)
195
+ expect(provider).to receive(:remove_package).with("emacs", nil)
196
196
  provider.run_action(:remove)
197
197
  expect(new_resource).to be_updated
198
198
  expect(new_resource).to be_updated_by_last_action
@@ -201,7 +201,7 @@ describe Chef::Provider::Package do
201
201
  it "should remove the package at a specific version if it is installed at that version" do
202
202
  new_resource.version "1.4.2"
203
203
  expect(provider).to be_removing_package
204
- expect(provider).to receive(:remove_package).with('emacs', '1.4.2')
204
+ expect(provider).to receive(:remove_package).with("emacs", "1.4.2")
205
205
  provider.run_action(:remove)
206
206
  expect(new_resource).to be_updated_by_last_action
207
207
  end
@@ -231,12 +231,12 @@ describe Chef::Provider::Package do
231
231
  describe "When purging the package" do
232
232
  before(:each) do
233
233
  allow(provider).to receive(:purge_package).and_return(true)
234
- current_resource.version '1.4.2'
234
+ current_resource.version "1.4.2"
235
235
  end
236
236
 
237
237
  it "should purge the package if it is installed" do
238
238
  expect(provider).to be_removing_package
239
- expect(provider).to receive(:purge_package).with('emacs', nil)
239
+ expect(provider).to receive(:purge_package).with("emacs", nil)
240
240
  provider.run_action(:purge)
241
241
  expect(new_resource).to be_updated
242
242
  expect(new_resource).to be_updated_by_last_action
@@ -245,7 +245,7 @@ describe Chef::Provider::Package do
245
245
  it "should purge the package at a specific version if it is installed at that version" do
246
246
  new_resource.version "1.4.2"
247
247
  expect(provider).to be_removing_package
248
- expect(provider).to receive(:purge_package).with('emacs', '1.4.2')
248
+ expect(provider).to receive(:purge_package).with("emacs", "1.4.2")
249
249
  provider.run_action(:purge)
250
250
  expect(new_resource).to be_updated_by_last_action
251
251
  end
@@ -280,9 +280,9 @@ describe Chef::Provider::Package do
280
280
  end
281
281
 
282
282
  it "should info log, reconfigure the package and update the resource" do
283
- allow(current_resource).to receive(:version).and_return('1.0')
283
+ allow(current_resource).to receive(:version).and_return("1.0")
284
284
  allow(new_resource).to receive(:response_file).and_return(true)
285
- expect(provider).to receive(:get_preseed_file).and_return('/var/cache/preseed-test')
285
+ expect(provider).to receive(:get_preseed_file).and_return("/var/cache/preseed-test")
286
286
  allow(provider).to receive(:preseed_package).and_return(true)
287
287
  allow(provider).to receive(:reconfig_package).and_return(true)
288
288
  expect(Chef::Log).to receive(:info).with("package[emacs] reconfigured")
@@ -301,7 +301,7 @@ describe Chef::Provider::Package do
301
301
  end
302
302
 
303
303
  it "should debug log and not reconfigure the package if no response_file is given" do
304
- allow(current_resource).to receive(:version).and_return('1.0')
304
+ allow(current_resource).to receive(:version).and_return("1.0")
305
305
  allow(new_resource).to receive(:response_file).and_return(nil)
306
306
  expect(Chef::Log).to receive(:debug).with("package[emacs] no response_file provided - nothing to do")
307
307
  expect(provider).not_to receive(:reconfig_package)
@@ -310,7 +310,7 @@ describe Chef::Provider::Package do
310
310
  end
311
311
 
312
312
  it "should debug log and not reconfigure the package if the response_file has not changed" do
313
- allow(current_resource).to receive(:version).and_return('1.0')
313
+ allow(current_resource).to receive(:version).and_return("1.0")
314
314
  allow(new_resource).to receive(:response_file).and_return(true)
315
315
  expect(provider).to receive(:get_preseed_file).and_return(false)
316
316
  allow(provider).to receive(:preseed_package).and_return(false)
@@ -323,19 +323,19 @@ describe Chef::Provider::Package do
323
323
 
324
324
  describe "when running commands to be implemented by subclasses" do
325
325
  it "should raises UnsupportedAction for install" do
326
- expect { provider.install_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
326
+ expect { provider.install_package("emacs", "1.4.2") }.to raise_error(Chef::Exceptions::UnsupportedAction)
327
327
  end
328
328
 
329
329
  it "should raises UnsupportedAction for upgrade" do
330
- expect { provider.upgrade_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
330
+ expect { provider.upgrade_package("emacs", "1.4.2") }.to raise_error(Chef::Exceptions::UnsupportedAction)
331
331
  end
332
332
 
333
333
  it "should raises UnsupportedAction for remove" do
334
- expect { provider.remove_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
334
+ expect { provider.remove_package("emacs", "1.4.2") }.to raise_error(Chef::Exceptions::UnsupportedAction)
335
335
  end
336
336
 
337
337
  it "should raises UnsupportedAction for purge" do
338
- expect { provider.purge_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
338
+ expect { provider.purge_package("emacs", "1.4.2") }.to raise_error(Chef::Exceptions::UnsupportedAction)
339
339
  end
340
340
 
341
341
  it "should raise UnsupportedAction for preseed_package" do
@@ -344,7 +344,7 @@ describe Chef::Provider::Package do
344
344
  end
345
345
 
346
346
  it "should raise UnsupportedAction for reconfig" do
347
- expect { provider.reconfig_package('emacs', '1.4.2') }.to raise_error(Chef::Exceptions::UnsupportedAction)
347
+ expect { provider.reconfig_package("emacs", "1.4.2") }.to raise_error(Chef::Exceptions::UnsupportedAction)
348
348
  end
349
349
  end
350
350
 
@@ -360,52 +360,52 @@ describe Chef::Provider::Package do
360
360
  end
361
361
  let(:run_context) { Chef::RunContext.new(node, cookbook_collection, events) }
362
362
  let(:new_resource) do
363
- new_resource = Chef::Resource::Package.new('emacs')
364
- new_resource.response_file('java.response')
365
- new_resource.cookbook_name = 'java'
363
+ new_resource = Chef::Resource::Package.new("emacs")
364
+ new_resource.response_file("java.response")
365
+ new_resource.cookbook_name = "java"
366
366
  new_resource
367
367
  end
368
368
 
369
369
  describe "creating the cookbook file resource to fetch the response file" do
370
370
  before do
371
- expect(Chef::FileCache).to receive(:create_cache_path).with('preseed/java').and_return("/tmp/preseed/java")
371
+ expect(Chef::FileCache).to receive(:create_cache_path).with("preseed/java").and_return("/tmp/preseed/java")
372
372
  end
373
373
 
374
374
  it "sets the preseed resource's runcontext to its own run context" do
375
375
  allow(Chef::FileCache).to receive(:create_cache_path).and_return("/tmp/preseed/java")
376
- expect(provider.preseed_resource('java', '6').run_context).not_to be_nil
377
- expect(provider.preseed_resource('java', '6').run_context).to equal(provider.run_context)
376
+ expect(provider.preseed_resource("java", "6").run_context).not_to be_nil
377
+ expect(provider.preseed_resource("java", "6").run_context).to equal(provider.run_context)
378
378
  end
379
379
 
380
380
  it "should set the cookbook name of the remote file to the new resources cookbook name" do
381
- expect(provider.preseed_resource('java', '6').cookbook_name).to eq('java')
381
+ expect(provider.preseed_resource("java", "6").cookbook_name).to eq("java")
382
382
  end
383
383
 
384
384
  it "should set remote files source to the new resources response file" do
385
- expect(provider.preseed_resource('java', '6').source).to eq('java.response')
385
+ expect(provider.preseed_resource("java", "6").source).to eq("java.response")
386
386
  end
387
387
 
388
388
  it "should never back up the cached response file" do
389
- expect(provider.preseed_resource('java', '6').backup).to be_falsey
389
+ expect(provider.preseed_resource("java", "6").backup).to be_falsey
390
390
  end
391
391
 
392
392
  it "sets the install path of the resource to $file_cache/$cookbook/$pkg_name-$pkg_version.seed" do
393
- expect(provider.preseed_resource('java', '6').path).to eq('/tmp/preseed/java/java-6.seed')
393
+ expect(provider.preseed_resource("java", "6").path).to eq("/tmp/preseed/java/java-6.seed")
394
394
  end
395
395
  end
396
396
 
397
397
  describe "when installing the preseed file to the cache location" do
398
- let(:response_file_destination) { Dir.tmpdir + '/preseed--java--java-6.seed' }
398
+ let(:response_file_destination) { Dir.tmpdir + "/preseed--java--java-6.seed" }
399
399
  let(:response_file_resource) {
400
400
  response_file_resource = Chef::Resource::CookbookFile.new(response_file_destination, run_context)
401
- response_file_resource.cookbook_name = 'java'
401
+ response_file_resource.cookbook_name = "java"
402
402
  response_file_resource.backup(false)
403
- response_file_resource.source('java.response')
403
+ response_file_resource.source("java.response")
404
404
  response_file_resource
405
405
  }
406
406
 
407
407
  before do
408
- expect(provider).to receive(:preseed_resource).with('java', '6').and_return(response_file_resource)
408
+ expect(provider).to receive(:preseed_resource).with("java", "6").and_return(response_file_resource)
409
409
  end
410
410
 
411
411
  after do
@@ -468,7 +468,7 @@ describe "Subclass with use_multipackage_api" do
468
468
  provider.candidate_version = [ "1.0" ]
469
469
  expect(provider).to receive(:install_package).with(
470
470
  [ "vim" ],
471
- [ "1.0" ]
471
+ [ "1.0" ],
472
472
  ).and_return(true)
473
473
  provider.run_action(:install)
474
474
  expect(new_resource).to be_updated_by_last_action
@@ -481,7 +481,7 @@ describe "Subclass with use_multipackage_api" do
481
481
  provider.candidate_version = [ "1.0" ]
482
482
  expect(provider).to receive(:install_package).with(
483
483
  [ "vim" ],
484
- [ "1.0" ]
484
+ [ "1.0" ],
485
485
  ).and_return(true)
486
486
  provider.run_action(:install)
487
487
  expect(new_resource).to be_updated_by_last_action
@@ -494,7 +494,7 @@ describe "Subclass with use_multipackage_api" do
494
494
  provider.candidate_version = [ "1.0" ]
495
495
  expect(provider).to receive(:upgrade_package).with(
496
496
  [ "vim" ],
497
- [ "1.0" ]
497
+ [ "1.0" ],
498
498
  ).and_return(true)
499
499
  provider.run_action(:upgrade)
500
500
  expect(new_resource).to be_updated_by_last_action
@@ -507,7 +507,7 @@ describe "Subclass with use_multipackage_api" do
507
507
  provider.candidate_version = [ "1.0" ]
508
508
  expect(provider).to receive(:upgrade_package).with(
509
509
  [ "vim" ],
510
- [ "1.0" ]
510
+ [ "1.0" ],
511
511
  ).and_return(true)
512
512
  provider.run_action(:upgrade)
513
513
  expect(new_resource).to be_updated_by_last_action
@@ -521,7 +521,7 @@ describe "Subclass with use_multipackage_api" do
521
521
  provider.candidate_version = [ "1.0" ]
522
522
  expect(provider).to receive(:remove_package).with(
523
523
  [ "vim" ],
524
- [ nil ]
524
+ [ nil ],
525
525
  ).and_return(true)
526
526
  provider.run_action(:remove)
527
527
  expect(new_resource).to be_updated_by_last_action
@@ -535,7 +535,7 @@ describe "Subclass with use_multipackage_api" do
535
535
  provider.candidate_version = [ "1.0" ]
536
536
  expect(provider).to receive(:purge_package).with(
537
537
  [ "vim" ],
538
- [ nil ]
538
+ [ nil ],
539
539
  ).and_return(true)
540
540
  provider.run_action(:purge)
541
541
  expect(new_resource).to be_updated_by_last_action
@@ -547,7 +547,7 @@ describe "Subclass with use_multipackage_api" do
547
547
  current_resource.package_name "vim"
548
548
  current_resource.version [ "1.0" ]
549
549
  allow(new_resource).to receive(:response_file).and_return(true)
550
- expect(provider).to receive(:get_preseed_file).and_return('/var/cache/preseed-test')
550
+ expect(provider).to receive(:get_preseed_file).and_return("/var/cache/preseed-test")
551
551
  allow(provider).to receive(:preseed_package).and_return(true)
552
552
  allow(provider).to receive(:reconfig_package).and_return(true)
553
553
  expect(provider).to receive(:reconfig_package).with(
@@ -563,8 +563,8 @@ describe "Chef::Provider::Package - Multi" do
563
563
  let(:node) { Chef::Node.new }
564
564
  let(:events) { Chef::EventDispatch::Dispatcher.new }
565
565
  let(:run_context) { Chef::RunContext.new(node, {}, events) }
566
- let(:new_resource) { Chef::Resource::Package.new(['emacs', 'vi']) }
567
- let(:current_resource) { Chef::Resource::Package.new(['emacs', 'vi']) }
566
+ let(:new_resource) { Chef::Resource::Package.new(["emacs", "vi"]) }
567
+ let(:current_resource) { Chef::Resource::Package.new(["emacs", "vi"]) }
568
568
  let(:candidate_version) { [ "1.0", "6.2" ] }
569
569
  let(:provider) do
570
570
  provider = Chef::Provider::Package.new(new_resource, run_context)
@@ -582,7 +582,7 @@ describe "Chef::Provider::Package - Multi" do
582
582
  it "installs the candidate versions when none are installed" do
583
583
  expect(provider).to receive(:install_package).with(
584
584
  ["emacs", "vi"],
585
- ["1.0", "6.2"]
585
+ ["1.0", "6.2"],
586
586
  ).and_return(true)
587
587
  provider.run_action(:install)
588
588
  expect(new_resource).to be_updated
@@ -590,30 +590,30 @@ describe "Chef::Provider::Package - Multi" do
590
590
 
591
591
  it "installs the candidate versions when some are installed" do
592
592
  expect(provider).to receive(:install_package).with(
593
- [ 'vi' ],
594
- [ '6.2' ]
593
+ [ "vi" ],
594
+ [ "6.2" ],
595
595
  ).and_return(true)
596
- current_resource.version(['1.0', nil])
596
+ current_resource.version(["1.0", nil])
597
597
  provider.run_action(:install)
598
598
  expect(new_resource).to be_updated
599
599
  end
600
600
 
601
601
  it "installs the specified version when some are out of date" do
602
- current_resource.version(['1.0', '6.2'])
603
- new_resource.version(['1.0', '6.1'])
602
+ current_resource.version(["1.0", "6.2"])
603
+ new_resource.version(["1.0", "6.1"])
604
604
  provider.run_action(:install)
605
605
  expect(new_resource).to be_updated
606
606
  end
607
607
 
608
608
  it "does not install any version if all are installed at the right version" do
609
- current_resource.version(['1.0', '6.2'])
610
- new_resource.version(['1.0', '6.2'])
609
+ current_resource.version(["1.0", "6.2"])
610
+ new_resource.version(["1.0", "6.2"])
611
611
  provider.run_action(:install)
612
612
  expect(new_resource).not_to be_updated_by_last_action
613
613
  end
614
614
 
615
615
  it "does not install any version if all are installed, and no version was specified" do
616
- current_resource.version(['1.0', '6.2'])
616
+ current_resource.version(["1.0", "6.2"])
617
617
  provider.run_action(:install)
618
618
  expect(new_resource).not_to be_updated_by_last_action
619
619
  end
@@ -625,42 +625,42 @@ describe "Chef::Provider::Package - Multi" do
625
625
  end
626
626
 
627
627
  it "raises an exception if one is not installed and no candidates are available" do
628
- current_resource.version(['1.0', nil])
629
- provider.candidate_version = ['1.0', nil]
628
+ current_resource.version(["1.0", nil])
629
+ provider.candidate_version = ["1.0", nil]
630
630
  expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
631
631
  end
632
632
 
633
633
  it "does not raise an exception if the packages are installed or have a candidate" do
634
- current_resource.version(['1.0', nil])
635
- provider.candidate_version = [nil, '6.2']
634
+ current_resource.version(["1.0", nil])
635
+ provider.candidate_version = [nil, "6.2"]
636
636
  expect { provider.run_action(:install) }.not_to raise_error
637
637
  end
638
638
 
639
639
  it "raises an exception if an explicit version is asked for, an old version is installed, but no candidate" do
640
- new_resource.version ['1.0', '6.2']
641
- current_resource.version(['1.0', '6.1'])
642
- provider.candidate_version = ['1.0', nil]
640
+ new_resource.version ["1.0", "6.2"]
641
+ current_resource.version(["1.0", "6.1"])
642
+ provider.candidate_version = ["1.0", nil]
643
643
  expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
644
644
  end
645
645
 
646
646
  it "does not raise an exception if an explicit version is asked for, and is installed, but no candidate" do
647
- new_resource.version ['1.0', '6.2']
648
- current_resource.version(['1.0', '6.2'])
649
- provider.candidate_version = ['1.0', nil]
647
+ new_resource.version ["1.0", "6.2"]
648
+ current_resource.version(["1.0", "6.2"])
649
+ provider.candidate_version = ["1.0", nil]
650
650
  expect { provider.run_action(:install) }.not_to raise_error
651
651
  end
652
652
 
653
653
  it "raise an exception if an explicit version is asked for, and is not installed, and no candidate" do
654
- new_resource.version ['1.0', '6.2']
655
- current_resource.version(['1.0', nil])
656
- provider.candidate_version = ['1.0', nil]
654
+ new_resource.version ["1.0", "6.2"]
655
+ current_resource.version(["1.0", nil])
656
+ provider.candidate_version = ["1.0", nil]
657
657
  expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package)
658
658
  end
659
659
 
660
660
  it "does not raise an exception if an explicit version is asked for, and is not installed, and there is a candidate" do
661
- new_resource.version ['1.0', '6.2']
662
- current_resource.version(['1.0', nil])
663
- provider.candidate_version = ['1.0', '6.2']
661
+ new_resource.version ["1.0", "6.2"]
662
+ current_resource.version(["1.0", nil])
663
+ provider.candidate_version = ["1.0", "6.2"]
664
664
  expect { provider.run_action(:install) }.not_to raise_error
665
665
  end
666
666
  end
@@ -672,27 +672,27 @@ describe "Chef::Provider::Package - Multi" do
672
672
  end
673
673
 
674
674
  it "should upgrade the package if the current versions are not the candidate version" do
675
- current_resource.version ['0.9', '6.1']
675
+ current_resource.version ["0.9", "6.1"]
676
676
  expect(provider).to receive(:upgrade_package).with(
677
677
  new_resource.package_name,
678
- provider.candidate_version
678
+ provider.candidate_version,
679
679
  ).and_return(true)
680
680
  provider.run_action(:upgrade)
681
681
  expect(new_resource).to be_updated_by_last_action
682
682
  end
683
683
 
684
684
  it "should upgrade the package if some of current versions are not the candidate versions" do
685
- current_resource.version ['1.0', '6.1']
685
+ current_resource.version ["1.0", "6.1"]
686
686
  expect(provider).to receive(:upgrade_package).with(
687
687
  ["vi"],
688
- ["6.2"]
688
+ ["6.2"],
689
689
  ).and_return(true)
690
690
  provider.run_action(:upgrade)
691
691
  expect(new_resource).to be_updated_by_last_action
692
692
  end
693
693
 
694
694
  it "should not install the package if the current versions are the candidate version" do
695
- current_resource.version ['1.0', '6.2']
695
+ current_resource.version ["1.0", "6.2"]
696
696
  expect(provider).not_to receive(:upgrade_package)
697
697
  provider.run_action(:upgrade)
698
698
  expect(new_resource).not_to be_updated_by_last_action
@@ -705,20 +705,20 @@ describe "Chef::Provider::Package - Multi" do
705
705
  end
706
706
 
707
707
  it "should raise an exception if one is not installed and no candidates are available" do
708
- current_resource.version(['1.0', nil])
709
- provider.candidate_version = ['1.0', nil]
708
+ current_resource.version(["1.0", nil])
709
+ provider.candidate_version = ["1.0", nil]
710
710
  expect { provider.run_action(:upgrade) }.to raise_error(Chef::Exceptions::Package)
711
711
  end
712
712
 
713
713
  it "should not raise an exception if the packages are installed or have a candidate" do
714
- current_resource.version(['1.0', nil])
715
- provider.candidate_version = [nil, '6.2']
714
+ current_resource.version(["1.0", nil])
715
+ provider.candidate_version = [nil, "6.2"]
716
716
  expect { provider.run_action(:upgrade) }.not_to raise_error
717
717
  end
718
718
 
719
719
  it "should not raise an exception if the packages are installed or have a candidate" do
720
- current_resource.version(['1.0', nil])
721
- provider.candidate_version = [nil, '6.2']
720
+ current_resource.version(["1.0", nil])
721
+ provider.candidate_version = [nil, "6.2"]
722
722
  expect { provider.run_action(:upgrade) }.not_to raise_error
723
723
  end
724
724
  end
@@ -726,44 +726,44 @@ describe "Chef::Provider::Package - Multi" do
726
726
  describe "When removing multiple packages " do
727
727
  before(:each) do
728
728
  allow(provider).to receive(:remove_package).and_return(true)
729
- current_resource.version ['1.0', '6.2']
729
+ current_resource.version ["1.0", "6.2"]
730
730
  end
731
731
 
732
732
  it "should remove the packages if all are installed" do
733
733
  expect(provider).to be_removing_package
734
- expect(provider).to receive(:remove_package).with(['emacs', 'vi'], nil)
734
+ expect(provider).to receive(:remove_package).with(["emacs", "vi"], nil)
735
735
  provider.run_action(:remove)
736
736
  expect(new_resource).to be_updated
737
737
  expect(new_resource).to be_updated_by_last_action
738
738
  end
739
739
 
740
740
  it "should remove the packages if some are installed" do
741
- current_resource.version ['1.0', nil]
741
+ current_resource.version ["1.0", nil]
742
742
  expect(provider).to be_removing_package
743
- expect(provider).to receive(:remove_package).with(['emacs', 'vi'], nil)
743
+ expect(provider).to receive(:remove_package).with(["emacs", "vi"], nil)
744
744
  provider.run_action(:remove)
745
745
  expect(new_resource).to be_updated
746
746
  expect(new_resource).to be_updated_by_last_action
747
747
  end
748
748
 
749
749
  it "should remove the packages at a specific version if they are installed at that version" do
750
- new_resource.version ['1.0', '6.2']
750
+ new_resource.version ["1.0", "6.2"]
751
751
  expect(provider).to be_removing_package
752
- expect(provider).to receive(:remove_package).with(['emacs', 'vi'], ['1.0', '6.2'])
752
+ expect(provider).to receive(:remove_package).with(["emacs", "vi"], ["1.0", "6.2"])
753
753
  provider.run_action(:remove)
754
754
  expect(new_resource).to be_updated_by_last_action
755
755
  end
756
756
 
757
757
  it "should remove the packages at a specific version any are is installed at that version" do
758
- new_resource.version ['0.5', '6.2']
758
+ new_resource.version ["0.5", "6.2"]
759
759
  expect(provider).to be_removing_package
760
- expect(provider).to receive(:remove_package).with(['emacs', 'vi'], ['0.5', '6.2'])
760
+ expect(provider).to receive(:remove_package).with(["emacs", "vi"], ["0.5", "6.2"])
761
761
  provider.run_action(:remove)
762
762
  expect(new_resource).to be_updated_by_last_action
763
763
  end
764
764
 
765
765
  it "should not remove the packages at a specific version if they are not installed at that version" do
766
- new_resource.version ['0.5', '6.0']
766
+ new_resource.version ["0.5", "6.0"]
767
767
  expect(provider).not_to be_removing_package
768
768
  expect(provider).not_to receive(:remove_package)
769
769
  provider.run_action(:remove)
@@ -782,44 +782,44 @@ describe "Chef::Provider::Package - Multi" do
782
782
  describe "When purging multiple packages " do
783
783
  before(:each) do
784
784
  allow(provider).to receive(:purge_package).and_return(true)
785
- current_resource.version ['1.0', '6.2']
785
+ current_resource.version ["1.0", "6.2"]
786
786
  end
787
787
 
788
788
  it "should purge the packages if all are installed" do
789
789
  expect(provider).to be_removing_package
790
- expect(provider).to receive(:purge_package).with(['emacs', 'vi'], nil)
790
+ expect(provider).to receive(:purge_package).with(["emacs", "vi"], nil)
791
791
  provider.run_action(:purge)
792
792
  expect(new_resource).to be_updated
793
793
  expect(new_resource).to be_updated_by_last_action
794
794
  end
795
795
 
796
796
  it "should purge the packages if some are installed" do
797
- current_resource.version ['1.0', nil]
797
+ current_resource.version ["1.0", nil]
798
798
  expect(provider).to be_removing_package
799
- expect(provider).to receive(:purge_package).with(['emacs', 'vi'], nil)
799
+ expect(provider).to receive(:purge_package).with(["emacs", "vi"], nil)
800
800
  provider.run_action(:purge)
801
801
  expect(new_resource).to be_updated
802
802
  expect(new_resource).to be_updated_by_last_action
803
803
  end
804
804
 
805
805
  it "should purge the packages at a specific version if they are installed at that version" do
806
- new_resource.version ['1.0', '6.2']
806
+ new_resource.version ["1.0", "6.2"]
807
807
  expect(provider).to be_removing_package
808
- expect(provider).to receive(:purge_package).with(['emacs', 'vi'], ['1.0', '6.2'])
808
+ expect(provider).to receive(:purge_package).with(["emacs", "vi"], ["1.0", "6.2"])
809
809
  provider.run_action(:purge)
810
810
  expect(new_resource).to be_updated_by_last_action
811
811
  end
812
812
 
813
813
  it "should purge the packages at a specific version any are is installed at that version" do
814
- new_resource.version ['0.5', '6.2']
814
+ new_resource.version ["0.5", "6.2"]
815
815
  expect(provider).to be_removing_package
816
- expect(provider).to receive(:purge_package).with(['emacs', 'vi'], ['0.5', '6.2'])
816
+ expect(provider).to receive(:purge_package).with(["emacs", "vi"], ["0.5", "6.2"])
817
817
  provider.run_action(:purge)
818
818
  expect(new_resource).to be_updated_by_last_action
819
819
  end
820
820
 
821
821
  it "should not purge the packages at a specific version if they are not installed at that version" do
822
- new_resource.version ['0.5', '6.0']
822
+ new_resource.version ["0.5", "6.0"]
823
823
  expect(provider).not_to be_removing_package
824
824
  expect(provider).not_to receive(:purge_package)
825
825
  provider.run_action(:purge)