chefspec 5.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -25
  3. data/CHANGELOG.md +506 -371
  4. data/Gemfile +9 -0
  5. data/README.md +118 -75
  6. data/chefspec.gemspec +4 -5
  7. data/examples/apt_package/recipes/purge.rb +2 -2
  8. data/examples/apt_package/recipes/reconfig.rb +2 -2
  9. data/examples/apt_package/recipes/remove.rb +2 -2
  10. data/examples/apt_package/recipes/upgrade.rb +2 -2
  11. data/examples/apt_package/spec/install_spec.rb +4 -1
  12. data/examples/apt_package/spec/purge_spec.rb +4 -1
  13. data/examples/apt_package/spec/reconfig_spec.rb +4 -1
  14. data/examples/apt_package/spec/remove_spec.rb +4 -1
  15. data/examples/apt_package/spec/upgrade_spec.rb +4 -1
  16. data/examples/apt_repository/spec/add_spec.rb +4 -1
  17. data/examples/apt_repository/spec/remove_spec.rb +4 -1
  18. data/examples/apt_update/recipes/periodic.rb +1 -1
  19. data/examples/apt_update/spec/periodic_spec.rb +5 -2
  20. data/examples/apt_update/spec/update_spec.rb +4 -1
  21. data/examples/attributes/spec/default_spec.rb +1 -1
  22. data/examples/batch/recipes/run.rb +0 -4
  23. data/examples/batch/spec/run_spec.rb +4 -10
  24. data/examples/bff_package/recipes/install.rb +13 -0
  25. data/examples/bff_package/recipes/purge.rb +13 -0
  26. data/examples/bff_package/recipes/remove.rb +13 -0
  27. data/examples/bff_package/recipes/upgrade.rb +13 -0
  28. data/examples/bff_package/spec/install_spec.rb +23 -0
  29. data/examples/bff_package/spec/purge_spec.rb +19 -0
  30. data/examples/bff_package/spec/remove_spec.rb +19 -0
  31. data/examples/bff_package/spec/upgrade_spec.rb +19 -0
  32. data/examples/cab_package/recipes/install.rb +13 -0
  33. data/examples/cab_package/recipes/remove.rb +13 -0
  34. data/examples/cab_package/spec/install_spec.rb +26 -0
  35. data/examples/cab_package/spec/remove_spec.rb +22 -0
  36. data/examples/cached/spec/default_spec.rb +1 -1
  37. data/examples/chef_gem/spec/install_spec.rb +1 -1
  38. data/examples/chef_gem/spec/purge_spec.rb +1 -1
  39. data/examples/chef_gem/spec/reconfig_spec.rb +1 -1
  40. data/examples/chef_gem/spec/remove_spec.rb +1 -1
  41. data/examples/chef_gem/spec/upgrade_spec.rb +1 -1
  42. data/examples/chocolatey_package/spec/install_spec.rb +4 -6
  43. data/examples/chocolatey_package/spec/remove_spec.rb +4 -6
  44. data/examples/chocolatey_package/spec/upgrade_spec.rb +4 -6
  45. data/examples/compile_time/spec/default_spec.rb +1 -1
  46. data/examples/cookbook_file/spec/create_if_missing_spec.rb +3 -3
  47. data/examples/cookbook_file/spec/create_spec.rb +3 -3
  48. data/examples/cookbook_file/spec/delete_spec.rb +1 -1
  49. data/examples/cookbook_file/spec/touch_spec.rb +1 -1
  50. data/examples/cron/spec/create_spec.rb +1 -1
  51. data/examples/cron/spec/delete_spec.rb +1 -1
  52. data/examples/custom_matcher/providers/thing.rb +1 -1
  53. data/examples/custom_matcher/spec/install_spec.rb +1 -1
  54. data/examples/custom_matcher/spec/remove_spec.rb +1 -1
  55. data/examples/custom_resource/libraries/matchers.rb +5 -0
  56. data/examples/custom_resource/recipes/default.rb +1 -0
  57. data/examples/custom_resource/resources/custom_resource.rb +9 -0
  58. data/examples/custom_resource/spec/default_spec.rb +18 -0
  59. data/examples/deploy/spec/deploy_spec.rb +1 -1
  60. data/examples/deploy/spec/force_deploy_spec.rb +1 -1
  61. data/examples/deploy/spec/rollback_spec.rb +1 -1
  62. data/examples/directory/spec/create_spec.rb +4 -4
  63. data/examples/directory/spec/delete_spec.rb +3 -3
  64. data/examples/dnf_package/recipes/install.rb +13 -0
  65. data/examples/dnf_package/recipes/purge.rb +13 -0
  66. data/examples/dnf_package/recipes/remove.rb +13 -0
  67. data/examples/dnf_package/recipes/upgrade.rb +13 -0
  68. data/examples/dnf_package/spec/install_spec.rb +26 -0
  69. data/examples/dnf_package/spec/purge_spec.rb +22 -0
  70. data/examples/dnf_package/spec/remove_spec.rb +22 -0
  71. data/examples/dnf_package/spec/upgrade_spec.rb +22 -0
  72. data/examples/do_nothing/spec/default_spec.rb +1 -1
  73. data/examples/dpkg_package/spec/install_spec.rb +4 -6
  74. data/examples/dpkg_package/spec/purge_spec.rb +4 -6
  75. data/examples/dpkg_package/spec/remove_spec.rb +4 -6
  76. data/examples/dsc_resource/recipes/{default.rb → run.rb} +6 -6
  77. data/examples/dsc_resource/spec/{default_spec.rb → run_spec.rb} +8 -10
  78. data/examples/dsc_script/recipes/run.rb +12 -0
  79. data/examples/dsc_script/spec/run_spec.rb +16 -0
  80. data/examples/env/spec/create_spec.rb +4 -6
  81. data/examples/env/spec/delete_spec.rb +4 -6
  82. data/examples/env/spec/modify_spec.rb +4 -6
  83. data/examples/erl_call/spec/run_spec.rb +1 -1
  84. data/examples/execute/spec/run_spec.rb +1 -1
  85. data/examples/expect_exception/spec/compile_error_spec.rb +1 -1
  86. data/examples/expect_exception/spec/converge_error_spec.rb +1 -1
  87. data/examples/expect_exception/spec/no_error_spec.rb +1 -1
  88. data/examples/file/spec/create_if_missing_spec.rb +3 -3
  89. data/examples/file/spec/create_spec.rb +3 -3
  90. data/examples/file/spec/delete_spec.rb +1 -1
  91. data/examples/file/spec/touch_spec.rb +1 -1
  92. data/examples/freebsd_package/spec/install_spec.rb +4 -1
  93. data/examples/freebsd_package/spec/remove_spec.rb +4 -1
  94. data/examples/gem_package/spec/install_spec.rb +1 -1
  95. data/examples/gem_package/spec/purge_spec.rb +1 -1
  96. data/examples/gem_package/spec/reconfig_spec.rb +1 -1
  97. data/examples/gem_package/spec/remove_spec.rb +1 -1
  98. data/examples/gem_package/spec/upgrade_spec.rb +1 -1
  99. data/examples/git/spec/checkout_spec.rb +1 -1
  100. data/examples/git/spec/export_spec.rb +1 -1
  101. data/examples/git/spec/sync_spec.rb +1 -1
  102. data/examples/group/spec/create_spec.rb +1 -1
  103. data/examples/group/spec/manage_spec.rb +1 -1
  104. data/examples/group/spec/modify_spec.rb +1 -1
  105. data/examples/group/spec/remove_spec.rb +1 -1
  106. data/examples/guards/spec/default_spec.rb +1 -1
  107. data/examples/heavy_provider_light_resource/libraries/resource_service.rb +1 -1
  108. data/examples/heavy_provider_light_resource/recipes/default.rb +1 -2
  109. data/examples/heavy_provider_light_resource/spec/provider_service_spec.rb +2 -2
  110. data/examples/homebrew_package/recipes/install.rb +13 -0
  111. data/examples/homebrew_package/recipes/purge.rb +13 -0
  112. data/examples/homebrew_package/recipes/remove.rb +13 -0
  113. data/examples/homebrew_package/recipes/upgrade.rb +13 -0
  114. data/examples/homebrew_package/spec/install_spec.rb +23 -0
  115. data/examples/homebrew_package/spec/purge_spec.rb +19 -0
  116. data/examples/homebrew_package/spec/remove_spec.rb +19 -0
  117. data/examples/homebrew_package/spec/upgrade_spec.rb +19 -0
  118. data/examples/http_request/spec/delete_spec.rb +1 -1
  119. data/examples/http_request/spec/get_spec.rb +1 -1
  120. data/examples/http_request/spec/head_spec.rb +1 -1
  121. data/examples/http_request/spec/options_spec.rb +1 -1
  122. data/examples/http_request/spec/post_spec.rb +1 -1
  123. data/examples/http_request/spec/put_spec.rb +1 -1
  124. data/examples/ifconfig/spec/add_spec.rb +1 -1
  125. data/examples/ifconfig/spec/delete_spec.rb +1 -1
  126. data/examples/ifconfig/spec/disable_spec.rb +1 -1
  127. data/examples/ifconfig/spec/enable_spec.rb +1 -1
  128. data/examples/include_recipe/spec/default_spec.rb +1 -1
  129. data/examples/ips_package/spec/install_spec.rb +4 -6
  130. data/examples/ips_package/spec/remove_spec.rb +4 -6
  131. data/examples/ips_package/spec/upgrade_spec.rb +4 -6
  132. data/examples/launchd/recipes/create.rb +5 -0
  133. data/examples/launchd/recipes/create_if_missing.rb +3 -0
  134. data/examples/launchd/recipes/delete.rb +3 -0
  135. data/examples/launchd/recipes/disable.rb +3 -0
  136. data/examples/launchd/recipes/enable.rb +3 -0
  137. data/examples/launchd/spec/create_if_missing_spec.rb +10 -0
  138. data/examples/launchd/spec/create_spec.rb +14 -0
  139. data/examples/launchd/spec/delete_spec.rb +10 -0
  140. data/examples/launchd/spec/disable_spec.rb +10 -0
  141. data/examples/launchd/spec/enable_spec.rb +10 -0
  142. data/examples/link/spec/create_spec.rb +1 -1
  143. data/examples/link/spec/delete_spec.rb +1 -1
  144. data/examples/link/spec/link_to_spec.rb +1 -1
  145. data/examples/log/spec/write_spec.rb +1 -1
  146. data/examples/macports_package/spec/install_spec.rb +1 -1
  147. data/examples/macports_package/spec/purge_spec.rb +1 -1
  148. data/examples/macports_package/spec/remove_spec.rb +1 -1
  149. data/examples/macports_package/spec/upgrade_spec.rb +1 -1
  150. data/examples/mdadm/spec/assemble_spec.rb +1 -1
  151. data/examples/mdadm/spec/create_spec.rb +1 -1
  152. data/examples/mdadm/spec/stop_spec.rb +1 -1
  153. data/examples/mount/spec/disable_spec.rb +1 -1
  154. data/examples/mount/spec/enable_spec.rb +1 -1
  155. data/examples/mount/spec/mount_spec.rb +1 -1
  156. data/examples/mount/spec/remount_spec.rb +1 -1
  157. data/examples/mount/spec/umount_spec.rb +1 -1
  158. data/examples/msu_package/recipes/install.rb +13 -0
  159. data/examples/msu_package/recipes/remove.rb +13 -0
  160. data/examples/msu_package/spec/install_spec.rb +26 -0
  161. data/examples/msu_package/spec/remove_spec.rb +22 -0
  162. data/examples/multiple_actions/recipes/reversed.rb +9 -0
  163. data/examples/multiple_actions/recipes/sequential.rb +5 -3
  164. data/examples/multiple_actions/spec/default_spec.rb +1 -1
  165. data/examples/multiple_actions/spec/reversed_spec.rb +17 -0
  166. data/examples/multiple_actions/spec/sequential_spec.rb +5 -4
  167. data/examples/multiple_run_action/recipes/default.rb +2 -2
  168. data/examples/multiple_run_action/spec/default_spec.rb +1 -1
  169. data/examples/notifications/spec/before_spec.rb +1 -1
  170. data/examples/notifications/spec/chained_spec.rb +1 -1
  171. data/examples/notifications/spec/default_spec.rb +1 -1
  172. data/examples/notifications/spec/delayed_spec.rb +1 -1
  173. data/examples/notifications/spec/immediately_spec.rb +1 -1
  174. data/examples/ohai/spec/reload_spec.rb +1 -1
  175. data/examples/openbsd_package/recipes/install.rb +13 -0
  176. data/examples/openbsd_package/recipes/purge.rb +13 -0
  177. data/examples/openbsd_package/recipes/remove.rb +13 -0
  178. data/examples/openbsd_package/recipes/upgrade.rb +13 -0
  179. data/examples/openbsd_package/spec/install_spec.rb +23 -0
  180. data/examples/openbsd_package/spec/purge_spec.rb +19 -0
  181. data/examples/openbsd_package/spec/remove_spec.rb +19 -0
  182. data/examples/openbsd_package/spec/upgrade_spec.rb +19 -0
  183. data/examples/osx_profile/recipes/install.rb +8 -0
  184. data/examples/osx_profile/recipes/remove.rb +8 -0
  185. data/examples/osx_profile/spec/install_spec.rb +15 -0
  186. data/examples/osx_profile/spec/remove_spec.rb +13 -0
  187. data/examples/package/recipes/install.rb +1 -1
  188. data/examples/package/recipes/purge.rb +1 -1
  189. data/examples/package/recipes/reconfig.rb +1 -1
  190. data/examples/package/recipes/remove.rb +1 -1
  191. data/examples/package/recipes/upgrade.rb +1 -1
  192. data/examples/package/spec/install_spec.rb +2 -2
  193. data/examples/package/spec/purge_spec.rb +2 -2
  194. data/examples/package/spec/reconfig_spec.rb +2 -2
  195. data/examples/package/spec/remove_spec.rb +2 -2
  196. data/examples/package/spec/upgrade_spec.rb +2 -2
  197. data/examples/pacman_package/spec/install_spec.rb +4 -6
  198. data/examples/pacman_package/spec/purge_spec.rb +4 -6
  199. data/examples/pacman_package/spec/remove_spec.rb +4 -6
  200. data/examples/pacman_package/spec/upgrade_spec.rb +4 -6
  201. data/examples/paludis_package/recipes/install.rb +13 -0
  202. data/examples/paludis_package/recipes/purge.rb +13 -0
  203. data/examples/paludis_package/recipes/remove.rb +13 -0
  204. data/examples/paludis_package/recipes/upgrade.rb +13 -0
  205. data/examples/paludis_package/spec/install_spec.rb +23 -0
  206. data/examples/paludis_package/spec/purge_spec.rb +19 -0
  207. data/examples/paludis_package/spec/remove_spec.rb +19 -0
  208. data/examples/paludis_package/spec/upgrade_spec.rb +19 -0
  209. data/examples/portage_package/spec/install_spec.rb +4 -1
  210. data/examples/portage_package/spec/purge_spec.rb +4 -1
  211. data/examples/portage_package/spec/remove_spec.rb +4 -1
  212. data/examples/portage_package/spec/upgrade_spec.rb +4 -1
  213. data/examples/powershell_script/recipes/run.rb +0 -4
  214. data/examples/powershell_script/spec/run_spec.rb +4 -10
  215. data/examples/reboot/spec/cancel_spec.rb +1 -2
  216. data/examples/reboot/spec/now_spec.rb +1 -2
  217. data/examples/reboot/spec/request_spec.rb +1 -2
  218. data/examples/registry_key/spec/create_if_missing_spec.rb +4 -1
  219. data/examples/registry_key/spec/create_spec.rb +4 -1
  220. data/examples/registry_key/spec/delete_key_spec.rb +4 -1
  221. data/examples/registry_key/spec/delete_spec.rb +4 -1
  222. data/examples/remote_directory/spec/create_if_missing_spec.rb +1 -1
  223. data/examples/remote_directory/spec/create_spec.rb +1 -1
  224. data/examples/remote_directory/spec/delete_spec.rb +1 -1
  225. data/examples/remote_file/spec/create_if_missing_spec.rb +1 -1
  226. data/examples/remote_file/spec/create_spec.rb +1 -1
  227. data/examples/remote_file/spec/delete_spec.rb +1 -1
  228. data/examples/remote_file/spec/touch_spec.rb +1 -1
  229. data/examples/render_file/spec/default_spec.rb +1 -1
  230. data/examples/render_file/spec/template_helpers_spec.rb +1 -1
  231. data/examples/roles/roles/role.rb +4 -4
  232. data/examples/roles/spec/default_spec.rb +1 -1
  233. data/examples/route/spec/add_spec.rb +1 -1
  234. data/examples/route/spec/delete_spec.rb +1 -1
  235. data/examples/rpm_package/spec/install_spec.rb +4 -6
  236. data/examples/rpm_package/spec/remove_spec.rb +4 -6
  237. data/examples/rpm_package/spec/upgrade_spec.rb +4 -6
  238. data/examples/ruby_block/recipes/create.rb +8 -0
  239. data/examples/ruby_block/spec/create_spec.rb +13 -0
  240. data/examples/ruby_block/spec/run_spec.rb +1 -1
  241. data/examples/script/recipes/run_bash.rb +0 -4
  242. data/examples/script/recipes/run_csh.rb +0 -4
  243. data/examples/script/recipes/run_ksh.rb +9 -0
  244. data/examples/script/recipes/run_perl.rb +0 -4
  245. data/examples/script/recipes/run_python.rb +0 -4
  246. data/examples/script/recipes/run_ruby.rb +0 -4
  247. data/examples/script/recipes/run_script.rb +0 -4
  248. data/examples/script/spec/run_bash_spec.rb +1 -5
  249. data/examples/script/spec/run_csh_spec.rb +1 -5
  250. data/examples/script/spec/run_ksh_spec.rb +19 -0
  251. data/examples/script/spec/run_perl_spec.rb +1 -5
  252. data/examples/script/spec/run_python_spec.rb +1 -5
  253. data/examples/script/spec/run_ruby_spec.rb +1 -5
  254. data/examples/script/spec/run_script_spec.rb +1 -5
  255. data/examples/server/spec/client_spec.rb +2 -2
  256. data/examples/server/spec/data_bag_spec.rb +9 -11
  257. data/examples/server/spec/environment_spec.rb +1 -1
  258. data/examples/server/spec/exotic_port_spec.rb +17 -0
  259. data/examples/server/spec/node_spec.rb +6 -6
  260. data/examples/server/spec/render_with_cached_spec.rb +1 -1
  261. data/examples/server/spec/role_spec.rb +1 -1
  262. data/examples/server/spec/search_spec.rb +2 -2
  263. data/examples/service/recipes/disable.rb +1 -1
  264. data/examples/service/recipes/enable.rb +1 -1
  265. data/examples/service/recipes/reload.rb +1 -1
  266. data/examples/service/recipes/restart.rb +1 -1
  267. data/examples/service/recipes/start.rb +1 -1
  268. data/examples/service/recipes/stop.rb +1 -1
  269. data/examples/service/spec/disable_spec.rb +1 -1
  270. data/examples/service/spec/enable_spec.rb +1 -1
  271. data/examples/service/spec/reload_spec.rb +1 -1
  272. data/examples/service/spec/restart_spec.rb +1 -1
  273. data/examples/service/spec/start_spec.rb +1 -1
  274. data/examples/service/spec/stop_spec.rb +1 -1
  275. data/examples/smartos_package/spec/install_spec.rb +4 -1
  276. data/examples/smartos_package/spec/remove_spec.rb +4 -1
  277. data/examples/smartos_package/spec/upgrade_spec.rb +4 -1
  278. data/examples/solaris_package/recipes/upgrade.rb +13 -0
  279. data/examples/solaris_package/spec/install_spec.rb +4 -1
  280. data/examples/solaris_package/spec/remove_spec.rb +4 -1
  281. data/examples/solaris_package/spec/upgrade_spec.rb +22 -0
  282. data/examples/state_attrs/providers/lwrp.rb +0 -1
  283. data/examples/state_attrs/spec/default_spec.rb +1 -1
  284. data/examples/step_into/spec/default_spec.rb +4 -4
  285. data/examples/stub_command/spec/default_spec.rb +3 -3
  286. data/examples/stub_data_bag/spec/default_spec.rb +3 -3
  287. data/examples/stub_data_bag_item/spec/default_spec.rb +5 -5
  288. data/examples/stub_search/recipes/block.rb +3 -0
  289. data/examples/stub_search/recipes/default.rb +2 -5
  290. data/examples/stub_search/spec/block_spec.rb +27 -0
  291. data/examples/stub_search/spec/default_spec.rb +5 -5
  292. data/examples/subscribes/spec/before_spec.rb +1 -1
  293. data/examples/subscribes/spec/chained_spec.rb +1 -1
  294. data/examples/subscribes/spec/default_spec.rb +1 -2
  295. data/examples/subscribes/spec/delayed_spec.rb +1 -1
  296. data/examples/subscribes/spec/immediately_spec.rb +1 -1
  297. data/examples/subversion/spec/checkout_spec.rb +1 -1
  298. data/examples/subversion/spec/export_spec.rb +1 -1
  299. data/examples/subversion/spec/force_export_spec.rb +1 -1
  300. data/examples/subversion/spec/sync_spec.rb +1 -1
  301. data/examples/systemd_unit/recipes/create.rb +3 -0
  302. data/examples/systemd_unit/recipes/delete.rb +3 -0
  303. data/examples/systemd_unit/recipes/disable.rb +3 -0
  304. data/examples/systemd_unit/recipes/enable.rb +3 -0
  305. data/examples/systemd_unit/recipes/mask.rb +3 -0
  306. data/examples/systemd_unit/recipes/reload_or_restart.rb +3 -0
  307. data/examples/systemd_unit/recipes/reload_or_try_restart.rb +3 -0
  308. data/examples/systemd_unit/recipes/restart.rb +3 -0
  309. data/examples/systemd_unit/recipes/start.rb +3 -0
  310. data/examples/systemd_unit/recipes/stop.rb +3 -0
  311. data/examples/systemd_unit/recipes/try_restart.rb +3 -0
  312. data/examples/systemd_unit/recipes/unmask.rb +3 -0
  313. data/examples/systemd_unit/spec/create_spec.rb +10 -0
  314. data/examples/systemd_unit/spec/delete_spec.rb +10 -0
  315. data/examples/systemd_unit/spec/disable_spec.rb +10 -0
  316. data/examples/systemd_unit/spec/enable_spec.rb +10 -0
  317. data/examples/systemd_unit/spec/mask_spec.rb +10 -0
  318. data/examples/systemd_unit/spec/reload_or_restart_spec.rb +10 -0
  319. data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +10 -0
  320. data/examples/systemd_unit/spec/restart_spec.rb +10 -0
  321. data/examples/systemd_unit/spec/start_spec.rb +10 -0
  322. data/examples/systemd_unit/spec/stop_spec.rb +10 -0
  323. data/examples/systemd_unit/spec/try_restart_spec.rb +10 -0
  324. data/examples/systemd_unit/spec/unmask_spec.rb +10 -0
  325. data/examples/template/spec/create_if_missing_spec.rb +3 -3
  326. data/examples/template/spec/create_spec.rb +3 -3
  327. data/examples/template/spec/delete_spec.rb +1 -1
  328. data/examples/template/spec/touch_spec.rb +1 -1
  329. data/examples/use_inline_resources/spec/default_spec.rb +3 -3
  330. data/examples/user/spec/create_spec.rb +4 -1
  331. data/examples/user/spec/lock_spec.rb +4 -1
  332. data/examples/user/spec/manage_spec.rb +4 -1
  333. data/examples/user/spec/modify_spec.rb +4 -1
  334. data/examples/user/spec/remove_spec.rb +4 -1
  335. data/examples/user/spec/unlock_spec.rb +4 -1
  336. data/examples/windows_package/spec/install_spec.rb +4 -6
  337. data/examples/windows_package/spec/remove_spec.rb +4 -6
  338. data/examples/windows_service/spec/configure_startup_spec.rb +4 -6
  339. data/examples/windows_service/spec/disable_spec.rb +4 -6
  340. data/examples/windows_service/spec/enable_spec.rb +4 -6
  341. data/examples/windows_service/spec/reload_spec.rb +4 -6
  342. data/examples/windows_service/spec/restart_spec.rb +4 -6
  343. data/examples/windows_service/spec/start_spec.rb +4 -6
  344. data/examples/windows_service/spec/stop_spec.rb +4 -6
  345. data/examples/yum_package/spec/install_spec.rb +4 -1
  346. data/examples/yum_package/spec/purge_spec.rb +4 -1
  347. data/examples/yum_package/spec/remove_spec.rb +4 -1
  348. data/examples/yum_package/spec/upgrade_spec.rb +4 -1
  349. data/examples/yum_repository/recipes/add.rb +8 -0
  350. data/examples/yum_repository/recipes/create.rb +8 -0
  351. data/examples/yum_repository/recipes/delete.rb +3 -0
  352. data/examples/yum_repository/recipes/makecache.rb +3 -0
  353. data/examples/yum_repository/recipes/remove.rb +7 -0
  354. data/examples/yum_repository/spec/add_spec.rb +12 -0
  355. data/examples/yum_repository/spec/create_spec.rb +17 -0
  356. data/examples/yum_repository/spec/delete_spec.rb +12 -0
  357. data/examples/yum_repository/spec/makecache_spec.rb +12 -0
  358. data/examples/yum_repository/spec/remove_spec.rb +12 -0
  359. data/examples/zypper_package/recipes/install.rb +13 -0
  360. data/examples/zypper_package/recipes/purge.rb +13 -0
  361. data/examples/zypper_package/recipes/remove.rb +13 -0
  362. data/examples/zypper_package/recipes/upgrade.rb +13 -0
  363. data/examples/zypper_package/spec/install_spec.rb +23 -0
  364. data/examples/zypper_package/spec/purge_spec.rb +19 -0
  365. data/examples/zypper_package/spec/remove_spec.rb +19 -0
  366. data/examples/zypper_package/spec/upgrade_spec.rb +19 -0
  367. data/features/apt_repository.feature +15 -0
  368. data/features/apt_update.feature +13 -0
  369. data/features/attributes.feature +1 -1
  370. data/features/bff_package.feature +12 -0
  371. data/features/cab_package.feature +21 -0
  372. data/features/chocolatey_package.feature +1 -6
  373. data/features/compile_time.feature +1 -1
  374. data/features/custom_resource.feature +7 -0
  375. data/features/dnf_package.feature +26 -0
  376. data/features/dsc_resource.feature +5 -4
  377. data/features/dsc_script.feature +10 -0
  378. data/features/exotic_zero_port.feature +7 -0
  379. data/features/homebrew_package.feature +12 -0
  380. data/features/launchd.feature +17 -0
  381. data/features/msu_package.feature +23 -0
  382. data/features/multiple_actions.feature +1 -0
  383. data/features/notifications.feature +0 -7
  384. data/features/openbsd_package.feature +12 -0
  385. data/features/osx_profile.feature +13 -0
  386. data/features/paludis_package.feature +12 -0
  387. data/features/roles.feature +1 -1
  388. data/features/ruby_block.feature +1 -0
  389. data/features/script.feature +1 -0
  390. data/features/server_on_disk.feature +16 -0
  391. data/features/solaris_package.feature +1 -0
  392. data/features/stub_search.feature +1 -1
  393. data/features/subscribes.feature +0 -7
  394. data/features/support/env.rb +8 -0
  395. data/features/support/exotic_zero_port.rb +3 -0
  396. data/features/support/on_disk.rb +7 -0
  397. data/features/systemd_unit.feature +27 -0
  398. data/features/windows_package.feature +0 -4
  399. data/features/yum_repository.feature +23 -0
  400. data/features/{easy_install_package.feature → zypper_package.feature} +2 -2
  401. data/lib/chefspec/api/bff_package.rb +154 -0
  402. data/lib/chefspec/api/cab_package.rb +80 -0
  403. data/lib/chefspec/api/dnf_package.rb +154 -0
  404. data/lib/chefspec/api/dsc_script.rb +37 -0
  405. data/lib/chefspec/api/homebrew_package.rb +154 -0
  406. data/lib/chefspec/api/launchd.rb +151 -0
  407. data/lib/chefspec/api/msu_package.rb +81 -0
  408. data/lib/chefspec/api/openbsd_package.rb +155 -0
  409. data/lib/chefspec/api/osx_profile.rb +63 -0
  410. data/lib/chefspec/api/paludis_package.rb +155 -0
  411. data/lib/chefspec/api/ruby_block.rb +31 -0
  412. data/lib/chefspec/api/script.rb +39 -0
  413. data/lib/chefspec/api/solaris_package.rb +37 -0
  414. data/lib/chefspec/api/systemd_unit.rb +353 -0
  415. data/lib/chefspec/api/yum_repository.rb +130 -0
  416. data/lib/chefspec/api/zypper_package.rb +154 -0
  417. data/lib/chefspec/api.rb +15 -0
  418. data/lib/chefspec/coverage.rb +25 -7
  419. data/lib/chefspec/extensions/chef/data_query.rb +6 -1
  420. data/lib/chefspec/extensions/chef/lwrp_base.rb +21 -35
  421. data/lib/chefspec/macros.rb +1 -1
  422. data/lib/chefspec/matchers/resource_matcher.rb +20 -27
  423. data/lib/chefspec/rspec.rb +3 -0
  424. data/lib/chefspec/server_methods.rb +9 -12
  425. data/lib/chefspec/server_runner.rb +2 -42
  426. data/lib/chefspec/solo_runner.rb +11 -10
  427. data/lib/chefspec/version.rb +1 -1
  428. data/lib/chefspec/zero_server.rb +140 -0
  429. data/lib/chefspec.rb +0 -1
  430. data/spec/unit/macros_spec.rb +2 -2
  431. data/spec/unit/solo_runner_spec.rb +3 -2
  432. data/templates/errors/may_need_to_specify_platform.erb +1 -1
  433. metadata +195 -26
  434. data/examples/easy_install_package/recipes/install.rb +0 -13
  435. data/examples/easy_install_package/recipes/purge.rb +0 -13
  436. data/examples/easy_install_package/recipes/remove.rb +0 -13
  437. data/examples/easy_install_package/recipes/upgrade.rb +0 -13
  438. data/examples/easy_install_package/spec/install_spec.rb +0 -23
  439. data/examples/easy_install_package/spec/purge_spec.rb +0 -19
  440. data/examples/easy_install_package/spec/remove_spec.rb +0 -19
  441. data/examples/easy_install_package/spec/upgrade_spec.rb +0 -19
  442. data/gemfiles/chefspec.gemfile +0 -15
  443. data/lib/chefspec/chef_backwards_compat.rb +0 -79
@@ -1,7 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'apt_package::upgrade' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
6
+ .converge(described_recipe)
7
+ end
5
8
 
6
9
  it 'upgrades a apt_package with an explicit action' do
7
10
  expect(chef_run).to upgrade_apt_package('explicit_action')
@@ -1,7 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'apt_repository::add' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
6
+ .converge(described_recipe)
7
+ end
5
8
 
6
9
  it 'adds a apt_repository with default action' do
7
10
  expect(chef_run).to add_apt_repository('default_action')
@@ -1,7 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'apt_repository::remove' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
6
+ .converge(described_recipe)
7
+ end
5
8
 
6
9
  it 'removes a apt_repository with default action' do
7
10
  expect(chef_run).to remove_apt_repository('explicit_remove_action')
@@ -1,4 +1,4 @@
1
- apt_repository 'default_action'
1
+ apt_update 'default_action'
2
2
 
3
3
  apt_update 'explicit_action' do
4
4
  action :periodic
@@ -1,14 +1,17 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'apt_update::periodic' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
6
+ .converge(described_recipe)
7
+ end
5
8
 
6
9
  it 'updates apt with default action' do
7
10
  expect(chef_run).to periodic_apt_update('default_action')
8
11
  expect(chef_run).to_not periodic_apt_update('not_default_action')
9
12
  end
10
13
 
11
- it 'installs a apt_repository with an explicit action' do
14
+ it 'installs an apt_repository with an explicit action' do
12
15
  expect(chef_run).to periodic_apt_update('explicit_action')
13
16
  end
14
17
  end
@@ -1,7 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'apt_update::update' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04')
6
+ .converge(described_recipe)
7
+ end
5
8
 
6
9
  it 'updates apt repo' do
7
10
  expect(chef_run).to update_apt_update('update_repo')
@@ -2,7 +2,7 @@ require 'chefspec'
2
2
 
3
3
  describe 'attributes::default' do
4
4
  let(:chef_run) do
5
- ChefSpec::SoloRunner.new do |node|
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
6
6
  node.automatic['ipaddress'] = '500.500.500.500' # Intentionally not a real IP
7
7
  node.normal['attributes']['message'] = 'The new message is here'
8
8
  end.converge(described_recipe)
@@ -7,7 +7,3 @@ end
7
7
  batch 'with_attributes' do
8
8
  flags '-f'
9
9
  end
10
-
11
- batch 'specifying the identity attribute' do
12
- command 'identity_attribute'
13
- end
@@ -1,12 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
- RSpec.configure do |config|
4
- config.platform = 'windows'
5
- config.version = '2012R2'
6
- end
7
-
8
3
  describe 'batch::run' do
9
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
10
8
 
11
9
  it 'runs a batch with the default action' do
12
10
  expect(chef_run).to run_batch('default_action')
@@ -21,8 +19,4 @@ describe 'batch::run' do
21
19
  expect(chef_run).to run_batch('with_attributes').with(flags: '-f')
22
20
  expect(chef_run).to_not run_batch('with_attributes').with(flags: '-x')
23
21
  end
24
-
25
- it 'runs a batch when specifying the identity attribute' do
26
- expect(chef_run).to run_batch('identity_attribute')
27
- end
28
22
  end
@@ -0,0 +1,13 @@
1
+ bff_package 'default_action'
2
+
3
+ bff_package 'explicit_action' do
4
+ action :install
5
+ end
6
+
7
+ bff_package 'with_attributes' do
8
+ version '1.0.0'
9
+ end
10
+
11
+ bff_package 'specifying the identity attribute' do
12
+ package_name 'identity_attribute'
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :purge
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :purge
8
+ end
9
+
10
+ bff_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :purge
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :remove
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :remove
8
+ end
9
+
10
+ bff_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :remove
13
+ end
@@ -0,0 +1,13 @@
1
+ bff_package 'explicit_action' do
2
+ action :upgrade
3
+ end
4
+
5
+ bff_package 'with_attributes' do
6
+ version '1.0.0'
7
+ action :upgrade
8
+ end
9
+
10
+ bff_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :upgrade
13
+ end
@@ -0,0 +1,23 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::install' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
5
+
6
+ it 'installs a bff_package with the default action' do
7
+ expect(chef_run).to install_bff_package('default_action')
8
+ expect(chef_run).to_not install_bff_package('not_default_action')
9
+ end
10
+
11
+ it 'installs a bff_package with an explicit action' do
12
+ expect(chef_run).to install_bff_package('explicit_action')
13
+ end
14
+
15
+ it 'installs a bff_package with attributes' do
16
+ expect(chef_run).to install_bff_package('with_attributes').with(version: '1.0.0')
17
+ expect(chef_run).to_not install_bff_package('with_attributes').with(version: '1.2.3')
18
+ end
19
+
20
+ it 'installs a bff_package when specifying the identity attribute' do
21
+ expect(chef_run).to install_bff_package('identity_attribute')
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::purge' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
5
+
6
+ it 'purges a bff_package with an explicit action' do
7
+ expect(chef_run).to purge_bff_package('explicit_action')
8
+ expect(chef_run).to_not purge_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'purges a bff_package with attributes' do
12
+ expect(chef_run).to purge_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not purge_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'purges a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to purge_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::remove' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
5
+
6
+ it 'removes a bff_package with an explicit action' do
7
+ expect(chef_run).to remove_bff_package('explicit_action')
8
+ expect(chef_run).to_not remove_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'removes a bff_package with attributes' do
12
+ expect(chef_run).to remove_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not remove_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'removes a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to remove_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'chefspec'
2
+
3
+ describe 'bff_package::upgrade' do
4
+ let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'aix', version: '7.1').converge(described_recipe) }
5
+
6
+ it 'upgrades a bff_package with an explicit action' do
7
+ expect(chef_run).to upgrade_bff_package('explicit_action')
8
+ expect(chef_run).to_not upgrade_bff_package('not_explicit_action')
9
+ end
10
+
11
+ it 'upgrades a bff_package with attributes' do
12
+ expect(chef_run).to upgrade_bff_package('with_attributes').with(version: '1.0.0')
13
+ expect(chef_run).to_not upgrade_bff_package('with_attributes').with(version: '1.2.3')
14
+ end
15
+
16
+ it 'upgrades a bff_package when specifying the identity attribute' do
17
+ expect(chef_run).to upgrade_bff_package('identity_attribute')
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ cab_package 'default_action'
2
+
3
+ cab_package 'explicit_action' do
4
+ action :install
5
+ end
6
+
7
+ cab_package 'with_attributes' do
8
+ version '1.2.3'
9
+ end
10
+
11
+ cab_package 'specifying the identity attribute' do
12
+ package_name 'identity_attribute'
13
+ end
@@ -0,0 +1,13 @@
1
+ cab_package 'explicit_action' do
2
+ action :remove
3
+ end
4
+
5
+ cab_package 'with_attributes' do
6
+ version '1.2.3'
7
+ action :remove
8
+ end
9
+
10
+ cab_package 'specifying the identity attribute' do
11
+ package_name 'identity_attribute'
12
+ action :remove
13
+ end
@@ -0,0 +1,26 @@
1
+ require 'chefspec'
2
+
3
+ describe 'cab_package::install' do
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
8
+
9
+ it 'installs a cab_package with the default action' do
10
+ expect(chef_run).to install_cab_package('default_action')
11
+ expect(chef_run).to_not install_cab_package('not_default_action')
12
+ end
13
+
14
+ it 'installs a cab_package with an explicit action' do
15
+ expect(chef_run).to install_cab_package('explicit_action')
16
+ end
17
+
18
+ it 'installs a cab_package with attributes' do
19
+ expect(chef_run).to install_cab_package('with_attributes').with(version: '1.2.3')
20
+ expect(chef_run).to_not install_cab_package('with_attributes').with(version: '1.2.4')
21
+ end
22
+
23
+ it 'installs a cab_package when specifying the identity attribute' do
24
+ expect(chef_run).to install_cab_package('identity_attribute')
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ require 'chefspec'
2
+
3
+ describe 'cab_package::remove' do
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
8
+
9
+ it 'removes a cab_package with an explicit action' do
10
+ expect(chef_run).to remove_cab_package('explicit_action')
11
+ expect(chef_run).to_not remove_cab_package('not_explicit_action')
12
+ end
13
+
14
+ it 'removes a cab_package with attributes' do
15
+ expect(chef_run).to remove_cab_package('with_attributes').with(version: '1.2.3')
16
+ expect(chef_run).to_not remove_cab_package('with_attributes').with(version: '1.2.4')
17
+ end
18
+
19
+ it 'removes a cab_package when specifying the identity attribute' do
20
+ expect(chef_run).to remove_cab_package('identity_attribute')
21
+ end
22
+ end
@@ -5,7 +5,7 @@ RSpec.configure do |config|
5
5
  end
6
6
 
7
7
  describe 'cached::default' do
8
- cached(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
8
+ cached(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
9
9
 
10
10
  it 'does not raise an exception' do
11
11
  expect { chef_run }.to_not raise_error
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'chef_gem::install' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'installs a chef_gem with the default action' do
7
7
  expect(chef_run).to install_chef_gem('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'chef_gem::purge' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'purges a chef_gem with an explicit action' do
7
7
  expect(chef_run).to purge_chef_gem('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'chef_gem::reconfig' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'reconfigs a chef_gem with an explicit action' do
7
7
  expect(chef_run).to reconfig_chef_gem('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'chef_gem::remove' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'removes a chef_gem with an explicit action' do
7
7
  expect(chef_run).to remove_chef_gem('explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'chef_gem::upgrade' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'upgrades a chef_gem with an explicit action' do
7
7
  expect(chef_run).to upgrade_chef_gem('explicit_action')
@@ -1,12 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
- RSpec.configure do |config|
4
- config.platform = 'windows'
5
- config.version = '2012R2'
6
- end
7
-
8
3
  describe 'chocolatey_package::install' do
9
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
10
8
 
11
9
  it 'installs a package' do
12
10
  expect(chef_run).to install_chocolatey_package('7zip')
@@ -1,12 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
- RSpec.configure do |config|
4
- config.platform = 'windows'
5
- config.version = '2012R2'
6
- end
7
-
8
3
  describe 'chocolatey_package::remove' do
9
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
10
8
 
11
9
  it 'removes a package' do
12
10
  expect(chef_run).to remove_chocolatey_package('7zip')
@@ -1,12 +1,10 @@
1
1
  require 'chefspec'
2
2
 
3
- RSpec.configure do |config|
4
- config.platform = 'windows'
5
- config.version = '2012R2'
6
- end
7
-
8
3
  describe 'chocolatey_package::upgrade' do
9
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'windows', version: '2012R2')
6
+ .converge(described_recipe)
7
+ end
10
8
 
11
9
  it 'upgrades a package' do
12
10
  expect(chef_run).to upgrade_chocolatey_package('7zip')
@@ -1,5 +1,5 @@
1
1
  describe 'compile_time::default' do
2
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
2
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
3
3
 
4
4
  it 'matches without .at_compile_time' do
5
5
  expect(chef_run).to install_package('compile_time')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cookbook_file::create_if_missing' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a cookbook_file with an explicit action' do
7
7
  expect(chef_run).to create_cookbook_file_if_missing('/tmp/explicit_action')
@@ -12,13 +12,13 @@ describe 'cookbook_file::create_if_missing' do
12
12
  expect(chef_run).to create_cookbook_file_if_missing('/tmp/with_attributes').with(
13
13
  user: 'user',
14
14
  group: 'group',
15
- backup: false,
15
+ backup: false
16
16
  )
17
17
 
18
18
  expect(chef_run).to_not create_cookbook_file_if_missing('/tmp/with_attributes').with(
19
19
  user: 'bacon',
20
20
  group: 'fat',
21
- backup: true,
21
+ backup: true
22
22
  )
23
23
  end
24
24
 
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cookbook_file::create' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a cookbook_file with the default action' do
7
7
  expect(chef_run).to create_cookbook_file('/tmp/default_action')
@@ -16,13 +16,13 @@ describe 'cookbook_file::create' do
16
16
  expect(chef_run).to create_cookbook_file('/tmp/with_attributes').with(
17
17
  user: 'user',
18
18
  group: 'group',
19
- backup: false,
19
+ backup: false
20
20
  )
21
21
 
22
22
  expect(chef_run).to_not create_cookbook_file_if_missing('/tmp/with_attributes').with(
23
23
  user: 'bacon',
24
24
  group: 'fat',
25
- backup: true,
25
+ backup: true
26
26
  )
27
27
  end
28
28
 
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cookbook_file::delete' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deletes a cookbook_file with an explicit action' do
7
7
  expect(chef_run).to delete_cookbook_file('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cookbook_file::touch' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'touches a cookbook_file with an explicit action' do
7
7
  expect(chef_run).to touch_cookbook_file('/tmp/explicit_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cron::create' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'creates a cron with the default action' do
7
7
  expect(chef_run).to create_cron('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'cron::delete' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deletes a cron with an explicit action' do
7
7
  expect(chef_run).to delete_cron('explicit_action')
@@ -1,2 +1,2 @@
1
- action(:install) {}
1
+ action(:install) {}
2
2
  action(:remove) {}
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'custom_matcher::install' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'installs a custom_matcher with the default action' do
7
7
  expect(chef_run).to install_custom_matcher_thing('default_action')
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'custom_matcher::remove' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'removes a custom_matcher with an explicit action' do
7
7
  expect(chef_run).to remove_custom_matcher_thing('explicit_action')
@@ -0,0 +1,5 @@
1
+ if defined?(ChefSpec)
2
+ def run_custom_resource(resource_name)
3
+ ChefSpec::Matchers::ResourceMatcher.new(:custom_resource, :run, resource_name)
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ custom_resource 'resource'
@@ -0,0 +1,9 @@
1
+ provides :custom_resource
2
+
3
+ property :name, name_property: true
4
+
5
+ action :run do
6
+ package('package') { action :install }
7
+ service('service') { action :start }
8
+ template('template') { action :create }
9
+ end
@@ -0,0 +1,18 @@
1
+ require 'chefspec'
2
+
3
+ describe 'custom_resource::default' do
4
+ let(:chef_run) do
5
+ ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04', step_into: ['custom_resource'])
6
+ .converge(described_recipe)
7
+ end
8
+
9
+ it 'uses the LWRP' do
10
+ expect(chef_run).to run_custom_resource('resource')
11
+ end
12
+
13
+ it 'steps into the LWRP' do
14
+ expect(chef_run).to install_package('package')
15
+ expect(chef_run).to start_service('service')
16
+ expect(chef_run).to create_template('template')
17
+ end
18
+ end
@@ -1,7 +1,7 @@
1
1
  require 'chefspec'
2
2
 
3
3
  describe 'deploy::deploy' do
4
- let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
4
+ let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
5
5
 
6
6
  it 'deploys a deploy with an explicit action' do
7
7
  expect(chef_run).to deploy_deploy('/tmp/explicit_action')