chefspec 7.3.2 → 7.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (637) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chefspec/extensions/.DS_Store +0 -0
  3. data/lib/chefspec/extensions/chef/.DS_Store +0 -0
  4. data/lib/chefspec/version.rb +1 -1
  5. metadata +7 -666
  6. data/.gitignore +0 -16
  7. data/.travis.yml +0 -48
  8. data/CHANGELOG.md +0 -819
  9. data/CONTRIBUTING.md +0 -52
  10. data/Gemfile +0 -23
  11. data/ISSUES.md +0 -41
  12. data/README.md +0 -571
  13. data/README_old.md +0 -1291
  14. data/Rakefile +0 -74
  15. data/chefspec.gemspec +0 -31
  16. data/examples/apt_package/recipes/install.rb +0 -13
  17. data/examples/apt_package/recipes/lock.rb +0 -13
  18. data/examples/apt_package/recipes/purge.rb +0 -13
  19. data/examples/apt_package/recipes/reconfig.rb +0 -13
  20. data/examples/apt_package/recipes/remove.rb +0 -13
  21. data/examples/apt_package/recipes/unlock.rb +0 -13
  22. data/examples/apt_package/recipes/upgrade.rb +0 -13
  23. data/examples/apt_package/spec/install_spec.rb +0 -26
  24. data/examples/apt_package/spec/lock_spec.rb +0 -22
  25. data/examples/apt_package/spec/purge_spec.rb +0 -22
  26. data/examples/apt_package/spec/reconfig_spec.rb +0 -22
  27. data/examples/apt_package/spec/remove_spec.rb +0 -22
  28. data/examples/apt_package/spec/unlock_spec.rb +0 -22
  29. data/examples/apt_package/spec/upgrade_spec.rb +0 -22
  30. data/examples/apt_repository/recipes/add.rb +0 -8
  31. data/examples/apt_repository/recipes/remove.rb +0 -4
  32. data/examples/apt_repository/spec/add_spec.rb +0 -17
  33. data/examples/apt_repository/spec/remove_spec.rb +0 -12
  34. data/examples/apt_update/recipes/periodic.rb +0 -5
  35. data/examples/apt_update/recipes/update.rb +0 -3
  36. data/examples/apt_update/spec/periodic_spec.rb +0 -17
  37. data/examples/apt_update/spec/update_spec.rb +0 -12
  38. data/examples/attributes/attributes/default.rb +0 -1
  39. data/examples/attributes/recipes/default.rb +0 -4
  40. data/examples/attributes/spec/default_spec.rb +0 -20
  41. data/examples/batch/recipes/run.rb +0 -9
  42. data/examples/batch/spec/run_spec.rb +0 -22
  43. data/examples/bff_package/recipes/install.rb +0 -13
  44. data/examples/bff_package/recipes/purge.rb +0 -13
  45. data/examples/bff_package/recipes/remove.rb +0 -13
  46. data/examples/bff_package/recipes/upgrade.rb +0 -13
  47. data/examples/bff_package/spec/install_spec.rb +0 -23
  48. data/examples/bff_package/spec/purge_spec.rb +0 -19
  49. data/examples/bff_package/spec/remove_spec.rb +0 -19
  50. data/examples/bff_package/spec/upgrade_spec.rb +0 -19
  51. data/examples/cab_package/recipes/install.rb +0 -13
  52. data/examples/cab_package/recipes/remove.rb +0 -13
  53. data/examples/cab_package/spec/install_spec.rb +0 -28
  54. data/examples/cab_package/spec/remove_spec.rb +0 -24
  55. data/examples/cached/recipes/default.rb +0 -1
  56. data/examples/cached/spec/default_spec.rb +0 -14
  57. data/examples/chef_gem/recipes/install.rb +0 -18
  58. data/examples/chef_gem/recipes/purge.rb +0 -16
  59. data/examples/chef_gem/recipes/reconfig.rb +0 -16
  60. data/examples/chef_gem/recipes/remove.rb +0 -16
  61. data/examples/chef_gem/recipes/upgrade.rb +0 -16
  62. data/examples/chef_gem/spec/install_spec.rb +0 -23
  63. data/examples/chef_gem/spec/purge_spec.rb +0 -19
  64. data/examples/chef_gem/spec/reconfig_spec.rb +0 -19
  65. data/examples/chef_gem/spec/remove_spec.rb +0 -19
  66. data/examples/chef_gem/spec/upgrade_spec.rb +0 -19
  67. data/examples/chocolatey_package/recipes/install.rb +0 -6
  68. data/examples/chocolatey_package/recipes/remove.rb +0 -8
  69. data/examples/chocolatey_package/recipes/upgrade.rb +0 -8
  70. data/examples/chocolatey_package/spec/install_spec.rb +0 -19
  71. data/examples/chocolatey_package/spec/remove_spec.rb +0 -18
  72. data/examples/chocolatey_package/spec/upgrade_spec.rb +0 -18
  73. data/examples/compile_time/recipes/default.rb +0 -3
  74. data/examples/compile_time/spec/default_spec.rb +0 -29
  75. data/examples/cookbook_file/recipes/create.rb +0 -15
  76. data/examples/cookbook_file/recipes/create_if_missing.rb +0 -15
  77. data/examples/cookbook_file/recipes/delete.rb +0 -15
  78. data/examples/cookbook_file/recipes/touch.rb +0 -15
  79. data/examples/cookbook_file/spec/create_if_missing_spec.rb +0 -28
  80. data/examples/cookbook_file/spec/create_spec.rb +0 -32
  81. data/examples/cookbook_file/spec/delete_spec.rb +0 -19
  82. data/examples/cookbook_file/spec/touch_spec.rb +0 -19
  83. data/examples/core/recipes/default.rb +0 -1
  84. data/examples/core/spec/default_spec.rb +0 -7
  85. data/examples/core/spec/non_recipe_spec.rb +0 -5
  86. data/examples/cron/recipes/create.rb +0 -10
  87. data/examples/cron/recipes/delete.rb +0 -9
  88. data/examples/cron/spec/create_spec.rb +0 -19
  89. data/examples/cron/spec/delete_spec.rb +0 -15
  90. data/examples/custom_matcher/libraries/matcher.rb +0 -1
  91. data/examples/custom_matcher/providers/thing.rb +0 -2
  92. data/examples/custom_matcher/recipes/install.rb +0 -13
  93. data/examples/custom_matcher/recipes/remove.rb +0 -13
  94. data/examples/custom_matcher/resources/thing.rb +0 -5
  95. data/examples/custom_matcher/spec/install_spec.rb +0 -27
  96. data/examples/custom_matcher/spec/remove_spec.rb +0 -23
  97. data/examples/custom_resource/recipes/default.rb +0 -1
  98. data/examples/custom_resource/resources/custom_resource.rb +0 -9
  99. data/examples/custom_resource/spec/default_spec.rb +0 -18
  100. data/examples/custom_resource_block/resources/default.rb +0 -3
  101. data/examples/custom_resource_block/spec/default_spec.rb +0 -10
  102. data/examples/directory/recipes/create.rb +0 -18
  103. data/examples/directory/recipes/delete.rb +0 -14
  104. data/examples/directory/spec/create_spec.rb +0 -34
  105. data/examples/directory/spec/delete_spec.rb +0 -26
  106. data/examples/dnf_package/recipes/install.rb +0 -13
  107. data/examples/dnf_package/recipes/purge.rb +0 -13
  108. data/examples/dnf_package/recipes/remove.rb +0 -13
  109. data/examples/dnf_package/recipes/upgrade.rb +0 -13
  110. data/examples/dnf_package/spec/install_spec.rb +0 -28
  111. data/examples/dnf_package/spec/purge_spec.rb +0 -24
  112. data/examples/dnf_package/spec/remove_spec.rb +0 -24
  113. data/examples/dnf_package/spec/upgrade_spec.rb +0 -24
  114. data/examples/do_nothing/recipes/default.rb +0 -3
  115. data/examples/do_nothing/spec/default_spec.rb +0 -15
  116. data/examples/dpkg_package/recipes/install.rb +0 -13
  117. data/examples/dpkg_package/recipes/purge.rb +0 -13
  118. data/examples/dpkg_package/recipes/remove.rb +0 -13
  119. data/examples/dpkg_package/spec/install_spec.rb +0 -26
  120. data/examples/dpkg_package/spec/purge_spec.rb +0 -22
  121. data/examples/dpkg_package/spec/remove_spec.rb +0 -22
  122. data/examples/dsc_resource/recipes/run.rb +0 -20
  123. data/examples/dsc_resource/spec/run_spec.rb +0 -38
  124. data/examples/dsc_script/recipes/run.rb +0 -12
  125. data/examples/dsc_script/spec/run_spec.rb +0 -16
  126. data/examples/env/recipes/create.rb +0 -13
  127. data/examples/env/recipes/delete.rb +0 -13
  128. data/examples/env/recipes/modify.rb +0 -13
  129. data/examples/env/spec/create_spec.rb +0 -26
  130. data/examples/env/spec/delete_spec.rb +0 -22
  131. data/examples/env/spec/modify_spec.rb +0 -22
  132. data/examples/execute/recipes/run.rb +0 -13
  133. data/examples/execute/spec/run_spec.rb +0 -23
  134. data/examples/expect_exception/recipes/compile_error.rb +0 -1
  135. data/examples/expect_exception/recipes/converge_error.rb +0 -5
  136. data/examples/expect_exception/recipes/no_error.rb +0 -1
  137. data/examples/expect_exception/spec/compile_error_spec.rb +0 -10
  138. data/examples/expect_exception/spec/converge_error_spec.rb +0 -10
  139. data/examples/expect_exception/spec/no_error_spec.rb +0 -10
  140. data/examples/file/recipes/create.rb +0 -15
  141. data/examples/file/recipes/create_if_missing.rb +0 -15
  142. data/examples/file/recipes/delete.rb +0 -15
  143. data/examples/file/recipes/touch.rb +0 -15
  144. data/examples/file/spec/create_if_missing_spec.rb +0 -28
  145. data/examples/file/spec/create_spec.rb +0 -32
  146. data/examples/file/spec/delete_spec.rb +0 -19
  147. data/examples/file/spec/touch_spec.rb +0 -19
  148. data/examples/freebsd_package/recipes/install.rb +0 -13
  149. data/examples/freebsd_package/recipes/remove.rb +0 -13
  150. data/examples/freebsd_package/spec/install_spec.rb +0 -26
  151. data/examples/freebsd_package/spec/remove_spec.rb +0 -22
  152. data/examples/gem_package/recipes/install.rb +0 -13
  153. data/examples/gem_package/recipes/purge.rb +0 -13
  154. data/examples/gem_package/recipes/reconfig.rb +0 -13
  155. data/examples/gem_package/recipes/remove.rb +0 -13
  156. data/examples/gem_package/recipes/upgrade.rb +0 -13
  157. data/examples/gem_package/spec/install_spec.rb +0 -23
  158. data/examples/gem_package/spec/purge_spec.rb +0 -19
  159. data/examples/gem_package/spec/reconfig_spec.rb +0 -19
  160. data/examples/gem_package/spec/remove_spec.rb +0 -19
  161. data/examples/gem_package/spec/upgrade_spec.rb +0 -19
  162. data/examples/git/recipes/checkout.rb +0 -13
  163. data/examples/git/recipes/export.rb +0 -13
  164. data/examples/git/recipes/sync.rb +0 -13
  165. data/examples/git/spec/checkout_spec.rb +0 -19
  166. data/examples/git/spec/export_spec.rb +0 -19
  167. data/examples/git/spec/sync_spec.rb +0 -23
  168. data/examples/group/recipes/create.rb +0 -13
  169. data/examples/group/recipes/manage.rb +0 -13
  170. data/examples/group/recipes/modify.rb +0 -13
  171. data/examples/group/recipes/remove.rb +0 -13
  172. data/examples/group/spec/create_spec.rb +0 -23
  173. data/examples/group/spec/manage_spec.rb +0 -19
  174. data/examples/group/spec/modify_spec.rb +0 -19
  175. data/examples/group/spec/remove_spec.rb +0 -18
  176. data/examples/guards/recipes/default.rb +0 -13
  177. data/examples/guards/spec/default_spec.rb +0 -17
  178. data/examples/heavy_provider_light_resource/libraries/resource_service.rb +0 -15
  179. data/examples/heavy_provider_light_resource/providers/service.rb +0 -9
  180. data/examples/heavy_provider_light_resource/recipes/default.rb +0 -3
  181. data/examples/heavy_provider_light_resource/spec/provider_service_spec.rb +0 -8
  182. data/examples/homebrew_package/recipes/install.rb +0 -13
  183. data/examples/homebrew_package/recipes/purge.rb +0 -13
  184. data/examples/homebrew_package/recipes/remove.rb +0 -13
  185. data/examples/homebrew_package/recipes/upgrade.rb +0 -13
  186. data/examples/homebrew_package/spec/install_spec.rb +0 -23
  187. data/examples/homebrew_package/spec/purge_spec.rb +0 -19
  188. data/examples/homebrew_package/spec/remove_spec.rb +0 -19
  189. data/examples/homebrew_package/spec/upgrade_spec.rb +0 -19
  190. data/examples/http_request/recipes/delete.rb +0 -13
  191. data/examples/http_request/recipes/get.rb +0 -13
  192. data/examples/http_request/recipes/head.rb +0 -13
  193. data/examples/http_request/recipes/options.rb +0 -13
  194. data/examples/http_request/recipes/post.rb +0 -13
  195. data/examples/http_request/recipes/put.rb +0 -13
  196. data/examples/http_request/spec/delete_spec.rb +0 -19
  197. data/examples/http_request/spec/get_spec.rb +0 -23
  198. data/examples/http_request/spec/head_spec.rb +0 -19
  199. data/examples/http_request/spec/options_spec.rb +0 -19
  200. data/examples/http_request/spec/post_spec.rb +0 -19
  201. data/examples/http_request/spec/put_spec.rb +0 -19
  202. data/examples/ifconfig/recipes/add.rb +0 -9
  203. data/examples/ifconfig/recipes/delete.rb +0 -8
  204. data/examples/ifconfig/recipes/disable.rb +0 -8
  205. data/examples/ifconfig/recipes/enable.rb +0 -8
  206. data/examples/ifconfig/spec/add_spec.rb +0 -19
  207. data/examples/ifconfig/spec/delete_spec.rb +0 -15
  208. data/examples/ifconfig/spec/disable_spec.rb +0 -15
  209. data/examples/ifconfig/spec/enable_spec.rb +0 -15
  210. data/examples/include_recipe/recipes/default.rb +0 -1
  211. data/examples/include_recipe/recipes/not.rb +0 -0
  212. data/examples/include_recipe/recipes/other.rb +0 -0
  213. data/examples/include_recipe/spec/default_spec.rb +0 -13
  214. data/examples/ips_package/recipes/install.rb +0 -13
  215. data/examples/ips_package/recipes/remove.rb +0 -13
  216. data/examples/ips_package/recipes/upgrade.rb +0 -13
  217. data/examples/ips_package/spec/install_spec.rb +0 -26
  218. data/examples/ips_package/spec/remove_spec.rb +0 -22
  219. data/examples/ips_package/spec/upgrade_spec.rb +0 -22
  220. data/examples/launchd/recipes/create.rb +0 -5
  221. data/examples/launchd/recipes/create_if_missing.rb +0 -3
  222. data/examples/launchd/recipes/delete.rb +0 -3
  223. data/examples/launchd/recipes/disable.rb +0 -3
  224. data/examples/launchd/recipes/enable.rb +0 -3
  225. data/examples/launchd/spec/create_if_missing_spec.rb +0 -10
  226. data/examples/launchd/spec/create_spec.rb +0 -14
  227. data/examples/launchd/spec/delete_spec.rb +0 -10
  228. data/examples/launchd/spec/disable_spec.rb +0 -10
  229. data/examples/launchd/spec/enable_spec.rb +0 -10
  230. data/examples/library_patch/libraries/default.rb +0 -5
  231. data/examples/library_patch/recipes/default.rb +0 -1
  232. data/examples/library_patch/spec/default_spec.rb +0 -14
  233. data/examples/link/recipes/create.rb +0 -13
  234. data/examples/link/recipes/delete.rb +0 -13
  235. data/examples/link/recipes/link_to.rb +0 -3
  236. data/examples/link/spec/create_spec.rb +0 -23
  237. data/examples/link/spec/delete_spec.rb +0 -19
  238. data/examples/link/spec/link_to_spec.rb +0 -11
  239. data/examples/log/recipes/write.rb +0 -13
  240. data/examples/log/spec/write_spec.rb +0 -24
  241. data/examples/macports_package/recipes/install.rb +0 -13
  242. data/examples/macports_package/recipes/purge.rb +0 -13
  243. data/examples/macports_package/recipes/remove.rb +0 -13
  244. data/examples/macports_package/recipes/upgrade.rb +0 -13
  245. data/examples/macports_package/spec/install_spec.rb +0 -23
  246. data/examples/macports_package/spec/purge_spec.rb +0 -19
  247. data/examples/macports_package/spec/remove_spec.rb +0 -19
  248. data/examples/macports_package/spec/upgrade_spec.rb +0 -19
  249. data/examples/mdadm/recipes/assemble.rb +0 -13
  250. data/examples/mdadm/recipes/create.rb +0 -13
  251. data/examples/mdadm/recipes/stop.rb +0 -13
  252. data/examples/mdadm/spec/assemble_spec.rb +0 -19
  253. data/examples/mdadm/spec/create_spec.rb +0 -23
  254. data/examples/mdadm/spec/stop_spec.rb +0 -19
  255. data/examples/mount/recipes/disable.rb +0 -8
  256. data/examples/mount/recipes/enable.rb +0 -8
  257. data/examples/mount/recipes/mount.rb +0 -9
  258. data/examples/mount/recipes/remount.rb +0 -8
  259. data/examples/mount/recipes/umount.rb +0 -8
  260. data/examples/mount/spec/disable_spec.rb +0 -15
  261. data/examples/mount/spec/enable_spec.rb +0 -15
  262. data/examples/mount/spec/mount_spec.rb +0 -19
  263. data/examples/mount/spec/remount_spec.rb +0 -15
  264. data/examples/mount/spec/umount_spec.rb +0 -15
  265. data/examples/msu_package/recipes/install.rb +0 -13
  266. data/examples/msu_package/recipes/remove.rb +0 -13
  267. data/examples/msu_package/spec/install_spec.rb +0 -28
  268. data/examples/msu_package/spec/remove_spec.rb +0 -24
  269. data/examples/multiple_actions/recipes/default.rb +0 -3
  270. data/examples/multiple_actions/recipes/reversed.rb +0 -9
  271. data/examples/multiple_actions/recipes/sequential.rb +0 -9
  272. data/examples/multiple_actions/spec/default_spec.rb +0 -14
  273. data/examples/multiple_actions/spec/reversed_spec.rb +0 -17
  274. data/examples/multiple_actions/spec/sequential_spec.rb +0 -17
  275. data/examples/multiple_run_action/recipes/default.rb +0 -5
  276. data/examples/multiple_run_action/spec/default_spec.rb +0 -18
  277. data/examples/nothing_matcher/recipes/default.rb +0 -13
  278. data/examples/nothing_matcher/spec/default_spec.rb +0 -20
  279. data/examples/notifications/recipes/before.rb +0 -7
  280. data/examples/notifications/recipes/chained.rb +0 -12
  281. data/examples/notifications/recipes/default.rb +0 -7
  282. data/examples/notifications/recipes/delayed.rb +0 -7
  283. data/examples/notifications/recipes/immediately.rb +0 -7
  284. data/examples/notifications/spec/before_spec.rb +0 -16
  285. data/examples/notifications/spec/chained_spec.rb +0 -21
  286. data/examples/notifications/spec/default_spec.rb +0 -16
  287. data/examples/notifications/spec/delayed_spec.rb +0 -16
  288. data/examples/notifications/spec/immediately_spec.rb +0 -16
  289. data/examples/ohai/recipes/reload.rb +0 -13
  290. data/examples/ohai/spec/reload_spec.rb +0 -23
  291. data/examples/openbsd_package/recipes/install.rb +0 -13
  292. data/examples/openbsd_package/recipes/purge.rb +0 -13
  293. data/examples/openbsd_package/recipes/remove.rb +0 -13
  294. data/examples/openbsd_package/recipes/upgrade.rb +0 -13
  295. data/examples/openbsd_package/spec/install_spec.rb +0 -23
  296. data/examples/openbsd_package/spec/purge_spec.rb +0 -19
  297. data/examples/openbsd_package/spec/remove_spec.rb +0 -19
  298. data/examples/openbsd_package/spec/upgrade_spec.rb +0 -19
  299. data/examples/osx_profile/recipes/install.rb +0 -8
  300. data/examples/osx_profile/recipes/remove.rb +0 -8
  301. data/examples/osx_profile/spec/install_spec.rb +0 -15
  302. data/examples/osx_profile/spec/remove_spec.rb +0 -13
  303. data/examples/package/recipes/install.rb +0 -17
  304. data/examples/package/recipes/lock.rb +0 -17
  305. data/examples/package/recipes/purge.rb +0 -17
  306. data/examples/package/recipes/reconfig.rb +0 -17
  307. data/examples/package/recipes/remove.rb +0 -17
  308. data/examples/package/recipes/unlock.rb +0 -17
  309. data/examples/package/recipes/upgrade.rb +0 -17
  310. data/examples/package/spec/install_spec.rb +0 -27
  311. data/examples/package/spec/lock_spec.rb +0 -23
  312. data/examples/package/spec/purge_spec.rb +0 -23
  313. data/examples/package/spec/reconfig_spec.rb +0 -23
  314. data/examples/package/spec/remove_spec.rb +0 -23
  315. data/examples/package/spec/unlock_spec.rb +0 -23
  316. data/examples/package/spec/upgrade_spec.rb +0 -23
  317. data/examples/pacman_package/recipes/install.rb +0 -13
  318. data/examples/pacman_package/recipes/purge.rb +0 -13
  319. data/examples/pacman_package/recipes/remove.rb +0 -13
  320. data/examples/pacman_package/recipes/upgrade.rb +0 -13
  321. data/examples/pacman_package/spec/install_spec.rb +0 -26
  322. data/examples/pacman_package/spec/purge_spec.rb +0 -22
  323. data/examples/pacman_package/spec/remove_spec.rb +0 -22
  324. data/examples/pacman_package/spec/upgrade_spec.rb +0 -22
  325. data/examples/paludis_package/recipes/install.rb +0 -13
  326. data/examples/paludis_package/recipes/purge.rb +0 -13
  327. data/examples/paludis_package/recipes/remove.rb +0 -13
  328. data/examples/paludis_package/recipes/upgrade.rb +0 -13
  329. data/examples/paludis_package/spec/install_spec.rb +0 -23
  330. data/examples/paludis_package/spec/purge_spec.rb +0 -19
  331. data/examples/paludis_package/spec/remove_spec.rb +0 -19
  332. data/examples/paludis_package/spec/upgrade_spec.rb +0 -19
  333. data/examples/portage_package/recipes/install.rb +0 -13
  334. data/examples/portage_package/recipes/purge.rb +0 -13
  335. data/examples/portage_package/recipes/remove.rb +0 -13
  336. data/examples/portage_package/recipes/upgrade.rb +0 -13
  337. data/examples/portage_package/spec/install_spec.rb +0 -26
  338. data/examples/portage_package/spec/purge_spec.rb +0 -22
  339. data/examples/portage_package/spec/remove_spec.rb +0 -22
  340. data/examples/portage_package/spec/upgrade_spec.rb +0 -22
  341. data/examples/powershell_script/recipes/run.rb +0 -9
  342. data/examples/powershell_script/spec/run_spec.rb +0 -22
  343. data/examples/reboot/recipes/cancel.rb +0 -3
  344. data/examples/reboot/recipes/now.rb +0 -3
  345. data/examples/reboot/recipes/request.rb +0 -3
  346. data/examples/reboot/spec/cancel_spec.rb +0 -9
  347. data/examples/reboot/spec/now_spec.rb +0 -9
  348. data/examples/reboot/spec/request_spec.rb +0 -9
  349. data/examples/recipe_block/metadata.rb +0 -1
  350. data/examples/recipe_block/spec/recipe_block_spec.rb +0 -34
  351. data/examples/recipe_block/templates/apache2.conf.erb +0 -1
  352. data/examples/registry_key/recipes/create.rb +0 -13
  353. data/examples/registry_key/recipes/create_if_missing.rb +0 -13
  354. data/examples/registry_key/recipes/delete.rb +0 -13
  355. data/examples/registry_key/recipes/delete_key.rb +0 -13
  356. data/examples/registry_key/spec/create_if_missing_spec.rb +0 -22
  357. data/examples/registry_key/spec/create_spec.rb +0 -26
  358. data/examples/registry_key/spec/delete_key_spec.rb +0 -22
  359. data/examples/registry_key/spec/delete_spec.rb +0 -22
  360. data/examples/remote_directory/recipes/create.rb +0 -13
  361. data/examples/remote_directory/recipes/create_if_missing.rb +0 -13
  362. data/examples/remote_directory/recipes/delete.rb +0 -13
  363. data/examples/remote_directory/spec/create_if_missing_spec.rb +0 -19
  364. data/examples/remote_directory/spec/create_spec.rb +0 -23
  365. data/examples/remote_directory/spec/delete_spec.rb +0 -19
  366. data/examples/remote_file/recipes/create.rb +0 -18
  367. data/examples/remote_file/recipes/create_if_missing.rb +0 -16
  368. data/examples/remote_file/recipes/delete.rb +0 -16
  369. data/examples/remote_file/recipes/touch.rb +0 -16
  370. data/examples/remote_file/spec/create_if_missing_spec.rb +0 -19
  371. data/examples/remote_file/spec/create_spec.rb +0 -23
  372. data/examples/remote_file/spec/delete_spec.rb +0 -19
  373. data/examples/remote_file/spec/touch_spec.rb +0 -19
  374. data/examples/render_file/files/default/cookbook_file +0 -1
  375. data/examples/render_file/recipes/default.rb +0 -15
  376. data/examples/render_file/recipes/template_helpers.rb +0 -9
  377. data/examples/render_file/spec/default_spec.rb +0 -166
  378. data/examples/render_file/spec/template_helpers_spec.rb +0 -10
  379. data/examples/render_file/templates/default/_partial.erb +0 -1
  380. data/examples/render_file/templates/default/partial.erb +0 -1
  381. data/examples/render_file/templates/default/template.erb +0 -1
  382. data/examples/render_file/templates/default/template_with_helper.erb +0 -1
  383. data/examples/roles/recipes/another.rb +0 -3
  384. data/examples/roles/recipes/default.rb +0 -1
  385. data/examples/roles/roles/role.rb +0 -9
  386. data/examples/roles/spec/default_spec.rb +0 -21
  387. data/examples/route/recipes/add.rb +0 -13
  388. data/examples/route/recipes/delete.rb +0 -13
  389. data/examples/route/spec/add_spec.rb +0 -23
  390. data/examples/route/spec/delete_spec.rb +0 -19
  391. data/examples/rpm_package/recipes/install.rb +0 -13
  392. data/examples/rpm_package/recipes/remove.rb +0 -13
  393. data/examples/rpm_package/recipes/upgrade.rb +0 -13
  394. data/examples/rpm_package/spec/install_spec.rb +0 -26
  395. data/examples/rpm_package/spec/remove_spec.rb +0 -22
  396. data/examples/rpm_package/spec/upgrade_spec.rb +0 -22
  397. data/examples/ruby_block/recipes/create.rb +0 -8
  398. data/examples/ruby_block/recipes/run.rb +0 -9
  399. data/examples/ruby_block/spec/create_spec.rb +0 -13
  400. data/examples/ruby_block/spec/run_spec.rb +0 -18
  401. data/examples/runner/recipes/default.rb +0 -1
  402. data/examples/runner/spec/default_spec.rb +0 -11
  403. data/examples/script/recipes/run_bash.rb +0 -9
  404. data/examples/script/recipes/run_csh.rb +0 -9
  405. data/examples/script/recipes/run_ksh.rb +0 -9
  406. data/examples/script/recipes/run_perl.rb +0 -9
  407. data/examples/script/recipes/run_python.rb +0 -9
  408. data/examples/script/recipes/run_ruby.rb +0 -9
  409. data/examples/script/recipes/run_script.rb +0 -9
  410. data/examples/script/spec/run_bash_spec.rb +0 -19
  411. data/examples/script/spec/run_csh_spec.rb +0 -19
  412. data/examples/script/spec/run_ksh_spec.rb +0 -19
  413. data/examples/script/spec/run_perl_spec.rb +0 -19
  414. data/examples/script/spec/run_python_spec.rb +0 -19
  415. data/examples/script/spec/run_ruby_spec.rb +0 -19
  416. data/examples/script/spec/run_script_spec.rb +0 -19
  417. data/examples/server/recipes/client.rb +0 -6
  418. data/examples/server/recipes/data_bag.rb +0 -7
  419. data/examples/server/recipes/environment.rb +0 -6
  420. data/examples/server/recipes/node.rb +0 -6
  421. data/examples/server/recipes/render_with_cached.rb +0 -3
  422. data/examples/server/recipes/role.rb +0 -6
  423. data/examples/server/recipes/search.rb +0 -5
  424. data/examples/server/spec/client_spec.rb +0 -18
  425. data/examples/server/spec/data_bag_spec.rb +0 -25
  426. data/examples/server/spec/environment_spec.rb +0 -18
  427. data/examples/server/spec/exotic_port_spec.rb +0 -30
  428. data/examples/server/spec/node_spec.rb +0 -49
  429. data/examples/server/spec/render_with_cached_spec.rb +0 -15
  430. data/examples/server/spec/role_spec.rb +0 -18
  431. data/examples/server/spec/search_spec.rb +0 -61
  432. data/examples/service/recipes/disable.rb +0 -13
  433. data/examples/service/recipes/enable.rb +0 -13
  434. data/examples/service/recipes/reload.rb +0 -13
  435. data/examples/service/recipes/restart.rb +0 -13
  436. data/examples/service/recipes/start.rb +0 -13
  437. data/examples/service/recipes/stop.rb +0 -13
  438. data/examples/service/spec/disable_spec.rb +0 -19
  439. data/examples/service/spec/enable_spec.rb +0 -19
  440. data/examples/service/spec/reload_spec.rb +0 -19
  441. data/examples/service/spec/restart_spec.rb +0 -19
  442. data/examples/service/spec/start_spec.rb +0 -19
  443. data/examples/service/spec/stop_spec.rb +0 -19
  444. data/examples/smartos_package/recipes/install.rb +0 -13
  445. data/examples/smartos_package/recipes/remove.rb +0 -13
  446. data/examples/smartos_package/recipes/upgrade.rb +0 -13
  447. data/examples/smartos_package/spec/install_spec.rb +0 -26
  448. data/examples/smartos_package/spec/remove_spec.rb +0 -22
  449. data/examples/smartos_package/spec/upgrade_spec.rb +0 -22
  450. data/examples/solaris_package/recipes/install.rb +0 -13
  451. data/examples/solaris_package/recipes/remove.rb +0 -13
  452. data/examples/solaris_package/recipes/upgrade.rb +0 -13
  453. data/examples/solaris_package/spec/install_spec.rb +0 -26
  454. data/examples/solaris_package/spec/remove_spec.rb +0 -22
  455. data/examples/solaris_package/spec/upgrade_spec.rb +0 -22
  456. data/examples/spec_attributes/attributes/default.rb +0 -1
  457. data/examples/spec_attributes/recipes/default.rb +0 -5
  458. data/examples/spec_attributes/spec/default_spec.rb +0 -63
  459. data/examples/spec_platform/recipes/default.rb +0 -3
  460. data/examples/spec_platform/spec/default_spec.rb +0 -36
  461. data/examples/spec_step_into/recipes/default.rb +0 -3
  462. data/examples/spec_step_into/resources/one.rb +0 -3
  463. data/examples/spec_step_into/resources/two.rb +0 -3
  464. data/examples/spec_step_into/spec/default_spec.rb +0 -50
  465. data/examples/state_attrs/providers/lwrp.rb +0 -2
  466. data/examples/state_attrs/recipes/default.rb +0 -3
  467. data/examples/state_attrs/resources/lwrp.rb +0 -6
  468. data/examples/state_attrs/spec/default_spec.rb +0 -12
  469. data/examples/step_into/providers/lwrp.rb +0 -3
  470. data/examples/step_into/providers/provides.rb +0 -3
  471. data/examples/step_into/recipes/default.rb +0 -3
  472. data/examples/step_into/resources/lwrp.rb +0 -4
  473. data/examples/step_into/resources/provides.rb +0 -6
  474. data/examples/step_into/spec/default_spec.rb +0 -30
  475. data/examples/stub_command/recipes/default.rb +0 -5
  476. data/examples/stub_command/recipes/other_recipe.rb +0 -3
  477. data/examples/stub_command/spec/default_spec.rb +0 -28
  478. data/examples/stub_data_bag/recipes/default.rb +0 -5
  479. data/examples/stub_data_bag/spec/default_spec.rb +0 -27
  480. data/examples/stub_data_bag_item/recipes/default.rb +0 -5
  481. data/examples/stub_data_bag_item/spec/default_spec.rb +0 -27
  482. data/examples/stub_node/recipes/default.rb +0 -0
  483. data/examples/stub_node/spec/default_spec.rb +0 -17
  484. data/examples/stub_search/recipes/block.rb +0 -3
  485. data/examples/stub_search/recipes/default.rb +0 -2
  486. data/examples/stub_search/spec/block_spec.rb +0 -27
  487. data/examples/stub_search/spec/default_spec.rb +0 -27
  488. data/examples/stubs_for/resources/default.rb +0 -27
  489. data/examples/stubs_for/resources/old.rb +0 -26
  490. data/examples/stubs_for/spec/default_spec.rb +0 -263
  491. data/examples/subscribes/recipes/before.rb +0 -5
  492. data/examples/subscribes/recipes/chained.rb +0 -10
  493. data/examples/subscribes/recipes/default.rb +0 -5
  494. data/examples/subscribes/recipes/delayed.rb +0 -5
  495. data/examples/subscribes/recipes/immediately.rb +0 -5
  496. data/examples/subscribes/spec/before_spec.rb +0 -16
  497. data/examples/subscribes/spec/chained_spec.rb +0 -21
  498. data/examples/subscribes/spec/default_spec.rb +0 -16
  499. data/examples/subscribes/spec/delayed_spec.rb +0 -16
  500. data/examples/subscribes/spec/immediately_spec.rb +0 -16
  501. data/examples/subversion/recipes/checkout.rb +0 -13
  502. data/examples/subversion/recipes/export.rb +0 -13
  503. data/examples/subversion/recipes/force_export.rb +0 -13
  504. data/examples/subversion/recipes/sync.rb +0 -13
  505. data/examples/subversion/spec/checkout_spec.rb +0 -19
  506. data/examples/subversion/spec/export_spec.rb +0 -19
  507. data/examples/subversion/spec/force_export_spec.rb +0 -19
  508. data/examples/subversion/spec/sync_spec.rb +0 -23
  509. data/examples/systemd_unit/recipes/create.rb +0 -3
  510. data/examples/systemd_unit/recipes/delete.rb +0 -3
  511. data/examples/systemd_unit/recipes/disable.rb +0 -3
  512. data/examples/systemd_unit/recipes/enable.rb +0 -3
  513. data/examples/systemd_unit/recipes/mask.rb +0 -3
  514. data/examples/systemd_unit/recipes/reload_or_restart.rb +0 -3
  515. data/examples/systemd_unit/recipes/reload_or_try_restart.rb +0 -3
  516. data/examples/systemd_unit/recipes/restart.rb +0 -3
  517. data/examples/systemd_unit/recipes/start.rb +0 -3
  518. data/examples/systemd_unit/recipes/stop.rb +0 -3
  519. data/examples/systemd_unit/recipes/try_restart.rb +0 -3
  520. data/examples/systemd_unit/recipes/unmask.rb +0 -3
  521. data/examples/systemd_unit/spec/create_spec.rb +0 -10
  522. data/examples/systemd_unit/spec/delete_spec.rb +0 -10
  523. data/examples/systemd_unit/spec/disable_spec.rb +0 -10
  524. data/examples/systemd_unit/spec/enable_spec.rb +0 -10
  525. data/examples/systemd_unit/spec/mask_spec.rb +0 -10
  526. data/examples/systemd_unit/spec/reload_or_restart_spec.rb +0 -10
  527. data/examples/systemd_unit/spec/reload_or_try_restart_spec.rb +0 -10
  528. data/examples/systemd_unit/spec/restart_spec.rb +0 -10
  529. data/examples/systemd_unit/spec/start_spec.rb +0 -10
  530. data/examples/systemd_unit/spec/stop_spec.rb +0 -10
  531. data/examples/systemd_unit/spec/try_restart_spec.rb +0 -10
  532. data/examples/systemd_unit/spec/unmask_spec.rb +0 -10
  533. data/examples/template/recipes/create.rb +0 -15
  534. data/examples/template/recipes/create_if_missing.rb +0 -15
  535. data/examples/template/recipes/delete.rb +0 -15
  536. data/examples/template/recipes/touch.rb +0 -15
  537. data/examples/template/spec/create_if_missing_spec.rb +0 -28
  538. data/examples/template/spec/create_spec.rb +0 -32
  539. data/examples/template/spec/delete_spec.rb +0 -19
  540. data/examples/template/spec/touch_spec.rb +0 -19
  541. data/examples/use_inline_resources/providers/lwrp.rb +0 -7
  542. data/examples/use_inline_resources/recipes/default.rb +0 -1
  543. data/examples/use_inline_resources/resources/lwrp.rb +0 -4
  544. data/examples/use_inline_resources/spec/default_spec.rb +0 -18
  545. data/examples/user/recipes/create.rb +0 -13
  546. data/examples/user/recipes/lock.rb +0 -13
  547. data/examples/user/recipes/manage.rb +0 -13
  548. data/examples/user/recipes/modify.rb +0 -13
  549. data/examples/user/recipes/remove.rb +0 -13
  550. data/examples/user/recipes/unlock.rb +0 -13
  551. data/examples/user/spec/create_spec.rb +0 -26
  552. data/examples/user/spec/lock_spec.rb +0 -22
  553. data/examples/user/spec/manage_spec.rb +0 -22
  554. data/examples/user/spec/modify_spec.rb +0 -22
  555. data/examples/user/spec/remove_spec.rb +0 -22
  556. data/examples/user/spec/unlock_spec.rb +0 -22
  557. data/examples/windows_package/recipes/install.rb +0 -13
  558. data/examples/windows_package/recipes/remove.rb +0 -13
  559. data/examples/windows_package/spec/install_spec.rb +0 -22
  560. data/examples/windows_package/spec/remove_spec.rb +0 -22
  561. data/examples/windows_service/recipes/configure_startup.rb +0 -13
  562. data/examples/windows_service/recipes/disable.rb +0 -13
  563. data/examples/windows_service/recipes/enable.rb +0 -13
  564. data/examples/windows_service/recipes/reload.rb +0 -13
  565. data/examples/windows_service/recipes/restart.rb +0 -13
  566. data/examples/windows_service/recipes/start.rb +0 -13
  567. data/examples/windows_service/recipes/stop.rb +0 -13
  568. data/examples/windows_service/spec/configure_startup_spec.rb +0 -22
  569. data/examples/windows_service/spec/disable_spec.rb +0 -22
  570. data/examples/windows_service/spec/enable_spec.rb +0 -22
  571. data/examples/windows_service/spec/reload_spec.rb +0 -22
  572. data/examples/windows_service/spec/restart_spec.rb +0 -22
  573. data/examples/windows_service/spec/start_spec.rb +0 -22
  574. data/examples/windows_service/spec/stop_spec.rb +0 -22
  575. data/examples/yum_package/recipes/install.rb +0 -13
  576. data/examples/yum_package/recipes/lock.rb +0 -13
  577. data/examples/yum_package/recipes/purge.rb +0 -13
  578. data/examples/yum_package/recipes/remove.rb +0 -13
  579. data/examples/yum_package/recipes/unlock.rb +0 -13
  580. data/examples/yum_package/recipes/upgrade.rb +0 -13
  581. data/examples/yum_package/spec/install_spec.rb +0 -26
  582. data/examples/yum_package/spec/lock_spec.rb +0 -22
  583. data/examples/yum_package/spec/purge_spec.rb +0 -22
  584. data/examples/yum_package/spec/remove_spec.rb +0 -22
  585. data/examples/yum_package/spec/unlock_spec.rb +0 -22
  586. data/examples/yum_package/spec/upgrade_spec.rb +0 -22
  587. data/examples/yum_repository/recipes/add.rb +0 -8
  588. data/examples/yum_repository/recipes/create.rb +0 -8
  589. data/examples/yum_repository/recipes/delete.rb +0 -3
  590. data/examples/yum_repository/recipes/makecache.rb +0 -3
  591. data/examples/yum_repository/recipes/remove.rb +0 -7
  592. data/examples/yum_repository/spec/add_spec.rb +0 -12
  593. data/examples/yum_repository/spec/create_spec.rb +0 -17
  594. data/examples/yum_repository/spec/delete_spec.rb +0 -12
  595. data/examples/yum_repository/spec/makecache_spec.rb +0 -12
  596. data/examples/yum_repository/spec/remove_spec.rb +0 -12
  597. data/examples/zypper_package/recipes/install.rb +0 -13
  598. data/examples/zypper_package/recipes/lock.rb +0 -13
  599. data/examples/zypper_package/recipes/purge.rb +0 -13
  600. data/examples/zypper_package/recipes/remove.rb +0 -13
  601. data/examples/zypper_package/recipes/unlock.rb +0 -13
  602. data/examples/zypper_package/recipes/upgrade.rb +0 -13
  603. data/examples/zypper_package/spec/install_spec.rb +0 -23
  604. data/examples/zypper_package/spec/lock_spec.rb +0 -19
  605. data/examples/zypper_package/spec/purge_spec.rb +0 -19
  606. data/examples/zypper_package/spec/remove_spec.rb +0 -19
  607. data/examples/zypper_package/spec/unlock_spec.rb +0 -19
  608. data/examples/zypper_package/spec/upgrade_spec.rb +0 -19
  609. data/spec/spec_helper.rb +0 -13
  610. data/spec/support/hash.rb +0 -35
  611. data/spec/unit/cacher_spec.rb +0 -70
  612. data/spec/unit/coverage/filters_spec.rb +0 -60
  613. data/spec/unit/deprecations_spec.rb +0 -53
  614. data/spec/unit/errors_spec.rb +0 -57
  615. data/spec/unit/expect_exception_spec.rb +0 -32
  616. data/spec/unit/macros_spec.rb +0 -119
  617. data/spec/unit/matchers/do_nothing_matcher.rb +0 -5
  618. data/spec/unit/matchers/include_recipe_matcher_spec.rb +0 -38
  619. data/spec/unit/matchers/link_to_matcher_spec.rb +0 -55
  620. data/spec/unit/matchers/notifications_matcher_spec.rb +0 -40
  621. data/spec/unit/matchers/render_file_matcher_spec.rb +0 -68
  622. data/spec/unit/matchers/resource_matcher_spec.rb +0 -5
  623. data/spec/unit/matchers/state_attrs_matcher_spec.rb +0 -68
  624. data/spec/unit/matchers/subscribes_matcher_spec.rb +0 -65
  625. data/spec/unit/renderer_spec.rb +0 -69
  626. data/spec/unit/server_runner_spec.rb +0 -28
  627. data/spec/unit/solo_runner_spec.rb +0 -171
  628. data/spec/unit/stubs/command_registry_spec.rb +0 -27
  629. data/spec/unit/stubs/command_stub_spec.rb +0 -61
  630. data/spec/unit/stubs/data_bag_item_registry_spec.rb +0 -39
  631. data/spec/unit/stubs/data_bag_item_stub_spec.rb +0 -36
  632. data/spec/unit/stubs/data_bag_registry_spec.rb +0 -39
  633. data/spec/unit/stubs/data_bag_stub_spec.rb +0 -35
  634. data/spec/unit/stubs/registry_spec.rb +0 -29
  635. data/spec/unit/stubs/search_registry_spec.rb +0 -39
  636. data/spec/unit/stubs/search_stub_spec.rb +0 -36
  637. data/spec/unit/stubs/stub_spec.rb +0 -64
@@ -1,52 +0,0 @@
1
- Contributing to ChefSpec
2
- ========================
3
- Pull requests are merged via Github, you can find the documentation about how to fork a repository and start contributing to ChefSpec here [https://help.github.com/articles/fork-a-repo](https://help.github.com/articles/fork-a-repo).
4
-
5
- All contributions are welcome to be submitted for review for inclusion, but before they will be accepted, we ask that you follow these simple steps:
6
-
7
- * [Coding standards](#coding-standards)
8
- * [Testing](#testing)
9
- * [Documentation](#documentation)
10
-
11
- Also, please be patient as not all items will be tested or reviewed immediately by the core team.
12
-
13
- Please be receptive and responsive to feedback about your additions or changes. The core team and/or other community members may make suggestions or ask questions about your change. This is part of the review process, and helps everyone to understand what is happening, why it is happening, and potentially optimizes your code.
14
-
15
- If you're looking to contribute but aren't sure where to start, check out the [open issues](https://github.com/chefspec/chefspec/issues?state=open).
16
-
17
-
18
- Will Not Merge
19
- --------------
20
- This section details, specifically, Pull Requests or features that will _not_ be merged:
21
-
22
- 1. Matchers for non-Chef core resources. ChefSpec 3.0 introduced a way for cookbook maintainers to [package matchers _with_ their cookbooks](https://github.com/chefspec/chefspec#packaging-custom-matchers) at distribution time.
23
- 2. New features without accompanying unit tests, cucumber tests, and documentation.
24
-
25
-
26
- Coding Standards
27
- ----------------
28
- The submitted code should be compatible with the standard Ruby coding guidelines. Here are some additional resources:
29
-
30
- * [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide)
31
- * [Github Styleguide](https://github.com/styleguide/ruby)
32
-
33
- There is a tool called [Cane](https://github.com/square/cane) that allows you to validate your code's ABC complexity and documentation.
34
-
35
-
36
- Testing
37
- -------
38
- Whether your pull request is a bug fix or introduces new classes or methods to the project, we kindly ask that you include tests for your changes. Even if it's just a small improvement, a test is necessary to ensure the bug is never re-introduced.
39
-
40
- We understand that not all users submitting pull requests will be proficient with RSpec. The maintainers and community as a whole are a helpful group and can help you with writing tests. The [Better Specs](http://betterspecs.org/) site should provide some helpful resources to get you started.
41
-
42
- ChefSpec is tested on [Travis CI](https://travis-ci.org/chefspec/chefspec) against multiple Chef Versions and Ruby Versions. **Your patches must work for all Chef and Ruby Versions on Travis.** This is in an effort to maintain backward compatibility as long as possible. For more information on which Chef and Ruby versions to support, checkout the [`.travis.yml`](https://github.com/chefspec/chefspec/blob/master/.travis.yml) file.
43
-
44
-
45
- Documentation
46
- -------------
47
- Documentation is a crucial part to ChefSpec, especially given its broad depth of features. All documentation is placed inline on the method matcher so it can be generated with Yard. Please see existing matchers for an example and check out the [Yard documentation](http://yardoc.info)
48
-
49
- When contributing new features, please ensure adequate documentation and examples are present.
50
-
51
- ---
52
- This contributing guide is based off of the [Joomla Contributing Guide](https://raw.github.com/joomla/joomla-framework/master/CONTRIBUTING.markdown).
data/Gemfile DELETED
@@ -1,23 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'rake'
7
- gem 'redcarpet'
8
- gem 'yard'
9
- gem 'pry'
10
- gem 'pry-byebug'
11
- end
12
-
13
- if ENV["GEMFILE_MOD"]
14
- puts "GEMFILE_MOD: #{ENV['GEMFILE_MOD']}"
15
- instance_eval(ENV["GEMFILE_MOD"])
16
- else
17
- gem 'chef', git: "https://github.com/chef/chef"
18
- gem 'ohai', git: "https://github.com/chef/ohai"
19
- end
20
-
21
- # If you want to load debugging tools into the bundle exec sandbox,
22
- # add these additional dependencies into Gemfile.local
23
- eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
data/ISSUES.md DELETED
@@ -1,41 +0,0 @@
1
- ChefSpec Issues
2
- ---------------
3
- This file documents the steps necessary to report and issue with ChefSpec. Following these guidelines will help ensure your issue is resolved in a timely manner.
4
-
5
- Reporting
6
- ---------
7
- When you report an issue, please include the following information:
8
-
9
- - What you're trying to accomplish
10
- - An [SSCCE](http://sscce.org/)
11
- - The command you ran
12
- - What you expected to happen
13
- - What actually happened
14
- - The exception backtrace(s), if any
15
- - What operating system and version
16
- - Everything output by running `env`
17
- - What version of Ruby you are using (run `ruby -v`)
18
- - What version of Rubygems you are using (run `gem -v`)
19
- - What version of Chef you are using (run `knife -v`)
20
-
21
- Here's a snippet you can copy-paste into the issue and fill out:
22
-
23
- ```text
24
- (What is the issue? What are you trying to do? What happened?)
25
-
26
- - Command: `...`
27
- - OS:
28
- - Ruby:
29
- - Rubygems:
30
- - Chef:
31
- - env:
32
- ```text
33
- # Paste your env here
34
- ```
35
- - Backtrace:
36
- ```text
37
- # Paste backtrace here
38
- ```
39
- ```
40
-
41
- [Create a ticket](https://github.com/chefspec/chefspec/issues/new) describing your problem and include the information above.
data/README.md DELETED
@@ -1,571 +0,0 @@
1
- # ChefSpec
2
-
3
- [![Gem Version](https://badge.fury.io/rb/chefspec.svg)](https://badge.fury.io/rb/chefspec) [![Build Status](https://travis-ci.org/chefspec/chefspec.svg?branch=master)](https://travis-ci.org/chefspec/chefspec)
4
-
5
- ChefSpec is a unit testing framework for testing Chef cookbooks. ChefSpec makes it easy to write examples and get fast feedback on cookbook changes without the need for virtual machines or cloud servers.
6
-
7
- ChefSpec runs your cookbooks locally while skipping making actual changes. This has two primary benefits:
8
-
9
- - It's really fast!
10
- - Your tests can vary node attributes, operating systems, and other system data to assert behavior under varying conditions.
11
-
12
- ## Important Notes
13
-
14
- - **ChefSpec requires Ruby 2.2 or later and Chef 12.14.89 or later!**
15
- - **This documentation corresponds to the master branch, which may be unreleased. Please check the README of the latest git tag or the gem's source for your version's documentation!**
16
-
17
- **ChefSpec aims to maintain compatibility with at least the two most recent minor versions of Chef.** If you are running an older version of Chef it may work, or you will need to run an older version of ChefSpec.
18
-
19
- As a general rule, if it is tested in the Travis CI matrix, it is a supported version.
20
-
21
- ## Quick Start
22
-
23
- ## When To Use ChefSpec?
24
-
25
- As mentioned before, ChefSpec is built for speed. In order to run your tests as
26
- quickly as possible (and to allow running tests on your workstation), ChefSpec
27
- runs your recipe code with all the resource actions disabled. This means that
28
- ChefSpec excels at testing complex logic in a cookbook, but can't actually tell
29
- you if a cookbook is doing the right thing. Integration testing is provided by
30
- the [Test Kitchen](https://kitchen.ci/) project, and for most simple cookbooks
31
- without much logic in them we recommend you start off with integration tests and
32
- only return to ChefSpec and unit tests as your code gets more complicated.
33
-
34
- There are two common "units" of code in Chef cookbooks, custom resources and
35
- recipes. If you find yourself with a lot of recipes that are so complex they
36
- require unit tests, consider if they can be refactored as custom resources.
37
-
38
- ### Testing a Custom Resource
39
-
40
- If you have have a cookbook with a custom resource `resources/greet.rb` like:
41
-
42
- ```ruby
43
- resource_name :mycookbook_greet
44
-
45
- property :greeting, String, default: 'Hello'
46
-
47
- action :run do
48
- log "#{new_resource.greeting} world"
49
- end
50
- ```
51
-
52
- You can test that resource by creating a spec file `spec/greet_spec.rb`:
53
-
54
- ```ruby
55
- # Load ChefSpec and put our test into ChefSpec mode.
56
- require 'chefspec'
57
-
58
- # Describing our custom resource.
59
- describe 'mycookbook_greet' do
60
- # Normally ChefSpec skips running resources, but for this test we want to
61
- # actually run this one custom resource.
62
- step_into :mycookbook_greet
63
- # Nothing in this test is platform-specific, so use the latest Ubuntu for
64
- # simulated data.
65
- platform 'ubuntu'
66
-
67
- # Create an example group for testing the resource defaults.
68
- context 'with the default greeting' do
69
- # Set the subject of this example group to a snippet of recipe code calling
70
- # our custom resource.
71
- recipe do
72
- mycookbook_greet 'test'
73
- end
74
-
75
- # Confirm that the resources created by our custom resource's action are
76
- # correct. ChefSpec matchers all take the form `action_type(name)`.
77
- it { is_expected.to write_log('Hello world') }
78
- end
79
-
80
- # Create a second example group to test a different block of recipe code.
81
- context 'with a custom greeting' do
82
- # This time our test recipe code sets a property on the custom resource.
83
- recipe do
84
- mycookbook_greet 'test' do
85
- greeting 'Bonjour'
86
- end
87
- end
88
-
89
- # Use the same kind of matcher as before to confirm the action worked.
90
- it { is_expected.to write_log('Bonjour world') }
91
- end
92
- end
93
- ```
94
-
95
- And then run your test using `chef exec rspec`.
96
-
97
- ### Testing a Recipe
98
-
99
- As a general rule of thumb, only very complex recipes benefit from ChefSpec unit
100
- tests. If you find yourself writing a lot of recipe unit tests, consider converting
101
- the recipes to custom resources instead. For the sake of example we'll use a
102
- simple recipe, `recipes/farewell.rb`:
103
-
104
- ```ruby
105
- log "#{node["mycookbook"]["farewell"]} world"
106
- ```
107
-
108
- You can test that recipe by creating a spec file `spec/farewell_spec.rb`:
109
-
110
- ```ruby
111
- # Load ChefSpec and put our test into ChefSpec mode.
112
- require 'chefspec'
113
-
114
- # Describing our recipe. The group name should be the recipe string as you would
115
- # use it with include_recipe.
116
- describe 'mycookbook::farewell' do
117
- # Nothing in this test is platform-specific, so use the latest Ubuntu for
118
- # simulated data.
119
- platform 'ubuntu'
120
-
121
- # Create an example group for testing the recipe defaults.
122
- context 'with default attributes' do
123
- # Since there was no `recipe do .. end` block here, the default subject is
124
- # recipe we named in the `describe`. ChefSpec matchers all take the form
125
- # `action_type(name)`.
126
- it { is_expected.to write_log('Goodbye world') }
127
- end
128
-
129
- # Create a second example group to test with attributes.
130
- context 'with a custom farewell' do
131
- # Set an override attribute for this group.
132
- override_attributes['mycookbook']['farewell'] = 'Adios'
133
-
134
- # Use the same kind of matcher as before to confirm the recipe worked.
135
- it { is_expected.to write_log('Adios world') }
136
- end
137
- end
138
- ```
139
-
140
- ## Cookbook Dependencies
141
-
142
- If your cookbook depends on other cookbooks, you must ensure ChefSpec knows how
143
- to fetch those dependencies. If you use a monorepo-style layout with all your
144
- cookbooks in a single `cookbooks/` folder, you don't need to do anything.
145
-
146
- If you are using Berkshelf, `require 'chefspec/berkshelf'` in your spec file (or `spec_helper.rb`):
147
-
148
- ```ruby
149
- require 'chefspec'
150
- require 'chefspec/berkshelf'
151
- ```
152
-
153
- If you are using a Policyfile, `require 'chefspec/policyfile'` in you spec file (or `spec_helper.rb`):
154
-
155
- ```ruby
156
- require 'chefspec'
157
- require 'chefspec/policyfile'
158
- ```
159
-
160
- Your `Policyfile.rb` should look something like this:
161
-
162
- ```ruby
163
- # The policy name is ignored but you need to specify one.
164
- name 'my_cookbook'
165
- # Pull dependent cookbooks from https://supermarket.chef.io/
166
- default_source :supermarket
167
- # The run list is also ignored by ChefSpec but you need to specify one.
168
- run_list 'my_cookbook::default'
169
- # The name here must match the name in metadata.rb.
170
- cookbook 'my_cookbook', path: '.'
171
- ```
172
-
173
- ## Writing Tests
174
-
175
- ChefSpec is an RSpec library, so if you're already familiar with RSpec you can
176
- use all the normal spec-y goodness to which you are accustomed. The usual structure
177
- of an RSpec test file is a file named like `spec/something_spec.rb` containing:
178
-
179
- ```ruby
180
- require 'chefspec'
181
-
182
- describe 'resource name or recipe' do
183
- # Some configuration for everything inside this `describe`.
184
- platform 'redhat', '7'
185
- default_attributes['value'] = 1
186
-
187
- context 'when some condition' do
188
- # Some configuration that only applies to this `context`.
189
- default_attributes['value'] = 2
190
-
191
- # `matcher` is some matcher function which we'll cover below.
192
- it { expect(value).to matcher }
193
- # There is a special value you can expect things on called `subject`, which
194
- # is the main thing being tested.
195
- it { expect(subject).to matcher }
196
- # And if prefer it for readability, `expect(subject)` can be written as `is_expected`.
197
- it { is_expected.to matcher }
198
- end
199
-
200
- context 'when some other condition' do
201
- # Repeat as needed.
202
- end
203
- end
204
- ```
205
-
206
- ### ChefSpec Matchers
207
-
208
- The primary matcher used with ChefSpec are resource matchers:
209
-
210
- ```ruby
211
- it { expect(chef_run).to ACTION_RESOURCE('NAME') }
212
- # Or equivalently.
213
- it { is_expected.to ACTION_RESOURCE('NAME') }
214
- ```
215
-
216
- This checks that a resource like `RESOURCE 'NAME'` would have run the specified
217
- action if the cookbook was executing normally. You can also test for specific
218
- property values:
219
-
220
- ```ruby
221
- it { is_expected.to create_user('asmithee').with(uid: 512, gid: 45) }
222
- # You can also use other RSpec matchers to create a "compound matcher". Check
223
- # RSpec documentation for a full reference on the built-in matchers.
224
- it { is_expected.to install_package('myapp').with(version: starts_with("3.")) }
225
- ```
226
-
227
- #### `render_file`
228
-
229
- For the common case of testing that a file is rendered to disk via either a
230
- `template`, `file`, or `cookbook_file` resource, you can use a `render_file`
231
- matcher:
232
-
233
- ```ruby
234
- it { is_expected.to render_file('/etc/myapp.conf') }
235
- # You can check for specific content in the file.
236
- it { is_expected.to render_file('/etc/myapp.conf').with_content("debug = false\n") }
237
- # Or with a regexp.
238
- it { is_expected.to render_file('/etc/myapp.conf').with_content(/user = \d+/) }
239
- # Or with a compound matcher.
240
- it { is_expected.to render_file('/etc/myapp.conf').with_content(start_with('# This file managed by Chef')) }
241
- # Or with a Ruby block of arbitrary assertions.
242
- it do
243
- is_expected.to render_file('/etc/myapp.conf').with_content { |content|
244
- # Arbitrary RSpec code goes here.
245
- }
246
- end
247
- ```
248
-
249
- #### Notifications
250
-
251
- As actions do not normally run in ChefSpec, testing for notifications is a special
252
- case. Unlike the resource matchers which evaluate against the ChefSpec runner,
253
- the notification matchers evaluate against a resource object:
254
-
255
- ```ruby
256
- # To match `notifies :run, 'execute[unpack]', :immediately
257
- it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]') }
258
- # To check for a specific notification action.
259
- it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]').to(:run) }
260
- # And to check for a specific timing.
261
- it { expect(chef_run.remote_file('/download')).to notify('execute[unpack]').to(:run).immediately }
262
- ```
263
-
264
- And similarly for subscriptions:
265
-
266
- ```ruby
267
- it { expect(chef_run.execute('unpack')).to subscribe_to('remote_file[/download]').on(:create) }
268
- ```
269
-
270
- ### Test Subject
271
-
272
- RSpec expectations always need a value to run against, with the main value being
273
- tested for a given example group (`describe` or `context` block) is called the
274
- `subject`. In ChefSpec this is almost always `ChefSpec::Runner` that has converge
275
- some recipe code.
276
-
277
- There are two ways to set which recipe code should be run for the test. More commonly
278
- for testing custom resources, you use the `recipe` helper method in the test to
279
- provide an in-line block of recipe code:
280
-
281
- ```ruby
282
- describe 'something' do
283
- recipe do
284
- my_custom_resource 'something' do
285
- debug true
286
- end
287
- end
288
- end
289
- ```
290
-
291
- By using an in-line block of recipe code, you can try many variations to test
292
- different configurations of your custom resource.
293
-
294
- If no `recipe` block is present, ChefSpec will use the name of the top-level
295
- `describe` block as a recipe name to run. So for the case of testing a recipe
296
- in your cookbook, use the `cookbookname::recipename` string as the label:
297
-
298
- ```ruby
299
- describe 'mycookbook'
300
- # Or.
301
- describe 'mycookbook::myrecipe'
302
- ```
303
-
304
- ### Test Settings
305
-
306
- Most ChefSpec configuration is set in your example groups (`describe` or `context`
307
- blocks) using helper methods. These all follow the RSpec convention of inheriting
308
- from a parent group to the groups inside it. So a setting in your top-level `describe`
309
- will automatically be set in any `context` unless overridden:
310
-
311
- ```ruby
312
- describe 'something' do
313
- platform 'ubuntu'
314
-
315
- # Platform is Ubuntu for any tests here.
316
- it { is_expected.to ... }
317
-
318
- context 'when something' do
319
- # Platform is still Ubuntu for any tests here.
320
- end
321
-
322
- context 'when something else' do
323
- platform 'fedora'
324
- # But platform here will be Fedora.
325
- end
326
- end
327
- ```
328
-
329
- #### Platform Data
330
-
331
- To support simulating Chef runs on the same OS as you use your cookbooks on, ChefSpec
332
- loads pre-fabricated Ohai data from [Fauxhai](https://github.com/chefspec/fauxhai/).
333
- To configure which OS' data is set for your test, use the `platform` helper method:
334
-
335
- ```ruby
336
- describe 'something' do
337
- platform 'ubuntu', '18.04'
338
- # ...
339
- end
340
- ```
341
-
342
- You can specify a partial version number to get the latest version of that OS
343
- matching the provided prefix, or leave the version off entirely to get the latest
344
- version overall:
345
-
346
- ```ruby
347
- # Will use the latest RedHat 7.x.
348
- platform 'redhat', '7'
349
- # Will use the latest version of Windows.
350
- platform 'windows'
351
- ```
352
-
353
- **WARNING:** If you leave off the version or use a partial version prefix, the
354
- behavior of your tests may change between versions of ChefDK as new data is
355
- available in Fauxhai. Only use this feature if you're certain that your tests
356
- do not (or should not) depend on the specifics of OS version.
357
-
358
- #### Node Attributes
359
-
360
- Node attributes are set using the `default_attributes`, `normal_attributes`,
361
- `override_attributes`, and `automatic_attributes` helper methods. These inherit
362
- from a parent group to its children using a deep merge, like in other places in
363
- Chef:
364
-
365
- ```ruby
366
- describe 'something' do
367
- default_attributes['myapp']['name'] = 'one'
368
- default_attributes['myapp']['email'] = 'myapp@example.com'
369
-
370
- context 'when something' do
371
- default_attributes['myapp']['name'] = 'two'
372
- end
373
- end
374
- ```
375
-
376
- Any values set using `automatic_attributes` take priority over Fauxhai data.
377
-
378
- #### Step Into
379
-
380
- Normally ChefSpec skips all resource (and provider) actions. When testing the
381
- implementation of a custom resource, we need to tell ChefSpec to run actions
382
- on our specific custom resource so it can be tested:
383
-
384
- ```ruby
385
- describe 'something' do
386
- step_into :my_custom_resource
387
- end
388
- ```
389
-
390
-
391
- #### Other ChefSpec Configuration
392
-
393
- You can specify any other ChefSpec configuration options using the `chefspec_options`
394
- helper:
395
-
396
- ```ruby
397
- describe 'something' do
398
- chefspec_options[:log_level] = :debug
399
- end
400
- ```
401
-
402
- ### Stubbing
403
-
404
- In order to keep unit tests fast and independent of the target system, we have to
405
- make sure that any interaction with the system (either the target node or the Chef
406
- Server, both parts of the system just in opposite directions) is replaced with a
407
- fake, local version. For some thing, like ensuring that resource actions are
408
- replaced with a no-op, the stubbing is automatic. For others, we need to tell ChefSpec
409
- how to handle things.
410
-
411
- #### Guards
412
-
413
- The most common case of interacting with the system is a guard clause on a resource:
414
-
415
- ```ruby
416
- not_if 'some command'
417
- # Or.
418
- only_if 'some command'
419
- ```
420
-
421
- In order for ChefSpec to know how to evaluate the resource, we need to tell it
422
- how the command would have returned for this test if it was running on the actual
423
- machine:
424
-
425
- ```ruby
426
- describe 'something' do
427
- recipe do
428
- execute '/opt/myapp/install.sh' do
429
- # Check if myapp is installed and runnable.
430
- not_if 'myapp --version'
431
- end
432
- end
433
-
434
- before do
435
- # Tell ChefSpec the command would have succeeded.
436
- stub_command('myapp --version').and_return(true)
437
- # Tell ChefSpec the command would have failed.
438
- stub_command('myapp --version').and_return(false)
439
- # You can also use a regexp to stub multiple commands at once.
440
- stub_command(/^myapp/).and_return(false)
441
- end
442
- end
443
- ```
444
-
445
- If using the Ruby code block form of a guard (e.g. `not_if { something }`), see
446
- the [Ruby stubbing section](#ruby-code) below.
447
-
448
- #### Search
449
-
450
- When testing code that uses the `search()` API in Chef, we have to stub out the
451
- results that would normally come from the Chef Server:
452
-
453
- ```ruby
454
- describe 'something' do
455
- recipe do
456
- web_servers = search(:node, 'roles:web').map { |n| n['hostname'] }
457
- end
458
-
459
- before do
460
- stub_search(:node, 'roles:web').and_return([{hostname: 'one'}, {hostname: two}])
461
- end
462
- end
463
- ```
464
-
465
- #### Data Bags
466
-
467
- Similar to the Search API, the `data_bag()` and `data_bag_item()` APIs normally
468
- fetch data from Chef Server so we need to stub their results:
469
-
470
- ```ruby
471
- describe 'something' do
472
- recipe do
473
- # Side note: don't write recipe code like this. This should be `search(:users, '*:*')`.
474
- users = data_bag('users').map do |user|
475
- data_bag_item('users', user['id'])
476
- end
477
- end
478
-
479
- before do
480
- stub_data_bag('users').and_return(['asmithee'])
481
- stub_data_bag_item('users', 'asmithee').and_return({uid: 1234})
482
- end
483
- end
484
- ```
485
-
486
- #### Resource and Provider Methods
487
-
488
- When testing custom resources, it is often useful to stub methods on the resource
489
- or provider instance. These can be set up using the `stubs_for_resource` and
490
- `stubs_for_provider` helpers:
491
-
492
- ```ruby
493
- describe 'something' do
494
- recipe do
495
- my_custom_resource 'something'
496
- end
497
-
498
- # Set up stubs for just the one resource.
499
- stubs_for_resource('my_custom_resource[something]') do |res|
500
- # Can use any RSpec Mocks code here, see below.
501
- allow(res).to receive(:something)
502
- end
503
- # Stubs for any instance of my_custom_resource.
504
- stubs_for_resource('my_custom_resource') do |res|
505
- # ...
506
- end
507
- # Stubs for any resource.
508
- stubs_for_resource do |res|
509
- # ...
510
- end
511
-
512
- # Stubs for the provider for just the one resource.
513
- stubs_for_provider('my_custom_resource[something]') do |res|
514
- # Can use any RSpec Mocks code here, see below.
515
- allow(res).to receive(:something)
516
- end
517
- # And similar to the above for any provider of a type or any overall.
518
- end
519
- ```
520
-
521
- By default, stubs for the resource will also be set up on the `current_resource`
522
- object. This can be disabled by using `stubs_for_resource('my_custom_resource[something]', current_resource: false)`.
523
- You can also manually set stubs for only the `current_resource` using `stubs_for_current_resource`.
524
-
525
- #### Ruby Code
526
-
527
- For more complex Ruby code, in recipes, libraries, or custom resources, you have
528
- the full power of RSpec and RSpec Mocks available to you:
529
-
530
- ```ruby
531
- before do
532
- allow(File).to receive(:exist?).and_call_original
533
- allow(File).to receive(:exist?).with('/test/path').and_return(true)
534
- end
535
- ```
536
-
537
- Check out the [RSpec Mocks documentation](https://relishapp.com/rspec/rspec-mocks/docs)
538
- for more information about setting up Ruby method stubs.
539
-
540
- ## Development
541
-
542
- 1. Fork the repository from GitHub.
543
- 2. Clone your fork to your local machine:
544
-
545
- ```
546
- $ git clone git@github.com:USER/chefspec.git
547
- ```
548
-
549
- 3. Create a git branch
550
-
551
- ```
552
- $ git checkout -b my_bug_fix
553
- ```
554
-
555
- 4. **Write tests**
556
-
557
- 5. Make your changes/patches/fixes, committing appropriately
558
-
559
- 6. Run the tests: `bundle exec rake`
560
-
561
- 7. Push your changes to GitHub
562
-
563
- 8. Open a Pull Request
564
-
565
- ChefSpec is on [Travis CI][travis] which tests against multiple Chef and Ruby versions.
566
-
567
- If you are contributing, please see the [Contributing Guidelines](https://github.com/chefspec/chefspec/blob/master/CONTRIBUTING.md) for more information.
568
-
569
- ## License
570
-
571
- MIT - see the accompanying [LICENSE](https://github.com/chefspec/chefspec/blob/master/LICENSE) file for details.