chef 18.8.11 → 18.8.54

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 (1125) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -19
  3. data/chef-universal-mingw-ucrt.gemspec +1 -1
  4. data/chef.gemspec +4 -5
  5. data/lib/chef/chef_fs/file_system/chef_server/cookbook_dir.rb +4 -0
  6. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb +1 -5
  7. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_entry.rb +12 -0
  8. data/lib/chef/chef_fs/file_system.rb +18 -0
  9. data/lib/chef/property.rb +6 -6
  10. data/lib/chef/provider/package/rubygems.rb +21 -0
  11. data/lib/chef/pwsh.rb +2 -5
  12. data/lib/chef/resource/apt_repository.rb +14 -5
  13. data/lib/chef/resource/chocolatey_installer.rb +19 -4
  14. data/lib/chef/resource/ohai.rb +1 -0
  15. data/lib/chef/resource_reporter.rb +1 -1
  16. data/lib/chef/shell.rb +8 -3
  17. data/lib/chef/version.rb +1 -1
  18. metadata +14 -1121
  19. data/spec/data/apt/chef-integration-test-1.0/debian/changelog +0 -5
  20. data/spec/data/apt/chef-integration-test-1.0/debian/compat +0 -1
  21. data/spec/data/apt/chef-integration-test-1.0/debian/control +0 -13
  22. data/spec/data/apt/chef-integration-test-1.0/debian/copyright +0 -34
  23. data/spec/data/apt/chef-integration-test-1.0/debian/files +0 -1
  24. data/spec/data/apt/chef-integration-test-1.0/debian/rules +0 -13
  25. data/spec/data/apt/chef-integration-test-1.0/debian/source/format +0 -1
  26. data/spec/data/apt/chef-integration-test-1.1/debian/changelog +0 -11
  27. data/spec/data/apt/chef-integration-test-1.1/debian/compat +0 -1
  28. data/spec/data/apt/chef-integration-test-1.1/debian/control +0 -13
  29. data/spec/data/apt/chef-integration-test-1.1/debian/copyright +0 -34
  30. data/spec/data/apt/chef-integration-test-1.1/debian/files +0 -1
  31. data/spec/data/apt/chef-integration-test-1.1/debian/rules +0 -13
  32. data/spec/data/apt/chef-integration-test-1.1/debian/source/format +0 -1
  33. data/spec/data/apt/chef-integration-test2-1.0/debian/changelog +0 -5
  34. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/conffiles +0 -1
  35. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/control +0 -10
  36. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2/DEBIAN/md5sums +0 -1
  37. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.debhelper.log +0 -45
  38. data/spec/data/apt/chef-integration-test2-1.0/debian/chef-integration-test2.substvars +0 -1
  39. data/spec/data/apt/chef-integration-test2-1.0/debian/compat +0 -1
  40. data/spec/data/apt/chef-integration-test2-1.0/debian/conffiles +0 -1
  41. data/spec/data/apt/chef-integration-test2-1.0/debian/control +0 -13
  42. data/spec/data/apt/chef-integration-test2-1.0/debian/copyright +0 -34
  43. data/spec/data/apt/chef-integration-test2-1.0/debian/files +0 -1
  44. data/spec/data/apt/chef-integration-test2-1.0/debian/rules +0 -13
  45. data/spec/data/apt/chef-integration-test2-1.0/debian/source/format +0 -1
  46. data/spec/data/apt/chef-integration-test2_1.0-1.debian.tar.gz +0 -0
  47. data/spec/data/apt/chef-integration-test2_1.0-1.dsc +0 -18
  48. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.build +0 -91
  49. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.changes +0 -31
  50. data/spec/data/apt/chef-integration-test2_1.0-1_amd64.deb +0 -0
  51. data/spec/data/apt/chef-integration-test2_1.0.orig.tar.gz +0 -0
  52. data/spec/data/apt/chef-integration-test_1.0-1_amd64.changes +0 -22
  53. data/spec/data/apt/chef-integration-test_1.0-1_amd64.deb +0 -0
  54. data/spec/data/apt/chef-integration-test_1.0.orig.tar.gz +0 -0
  55. data/spec/data/apt/chef-integration-test_1.1-1_amd64.changes +0 -22
  56. data/spec/data/apt/chef-integration-test_1.1-1_amd64.deb +0 -0
  57. data/spec/data/apt/chef-integration-test_1.1.orig.tar.gz +0 -0
  58. data/spec/data/apt/var/www/apt/conf/distributions +0 -7
  59. data/spec/data/apt/var/www/apt/conf/incoming +0 -4
  60. data/spec/data/apt/var/www/apt/conf/pulls +0 -3
  61. data/spec/data/apt/var/www/apt/db/checksums.db +0 -0
  62. data/spec/data/apt/var/www/apt/db/contents.cache.db +0 -0
  63. data/spec/data/apt/var/www/apt/db/packages.db +0 -0
  64. data/spec/data/apt/var/www/apt/db/references.db +0 -0
  65. data/spec/data/apt/var/www/apt/db/release.caches.db +0 -0
  66. data/spec/data/apt/var/www/apt/db/version +0 -4
  67. data/spec/data/apt/var/www/apt/dists/sid/Release +0 -19
  68. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages +0 -16
  69. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Packages.gz +0 -0
  70. data/spec/data/apt/var/www/apt/dists/sid/main/binary-amd64/Release +0 -5
  71. data/spec/data/apt/var/www/apt/dists/sid/main/binary-i386/Packages +0 -0
  72. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.0-1_amd64.deb +0 -0
  73. data/spec/data/apt/var/www/apt/pool/main/c/chef-integration-test/chef-integration-test_1.1-1_amd64.deb +0 -0
  74. data/spec/data/archive_file/test_archive.tar.gz +0 -0
  75. data/spec/data/bad-config.rb +0 -1
  76. data/spec/data/bootstrap/encrypted_data_bag_secret +0 -1
  77. data/spec/data/bootstrap/no_proxy.erb +0 -2
  78. data/spec/data/bootstrap/secret.erb +0 -9
  79. data/spec/data/bootstrap/test-hints.erb +0 -12
  80. data/spec/data/bootstrap/test.erb +0 -1
  81. data/spec/data/cb_version_cookbooks/cookbook2/files/test.txt +0 -0
  82. data/spec/data/cb_version_cookbooks/cookbook2/templates/test.erb +0 -0
  83. data/spec/data/cb_version_cookbooks/tatft/README.rdoc +0 -3
  84. data/spec/data/cb_version_cookbooks/tatft/attributes/default.rb +0 -1
  85. data/spec/data/cb_version_cookbooks/tatft/definitions/runit_service.rb +0 -1
  86. data/spec/data/cb_version_cookbooks/tatft/files/default/giant_blob.tgz +0 -1
  87. data/spec/data/cb_version_cookbooks/tatft/libraries/ownage.rb +0 -1
  88. data/spec/data/cb_version_cookbooks/tatft/providers/lwp.rb +0 -1
  89. data/spec/data/cb_version_cookbooks/tatft/recipes/default.rb +0 -1
  90. data/spec/data/cb_version_cookbooks/tatft/resources/lwr.rb +0 -1
  91. data/spec/data/cb_version_cookbooks/tatft/templates/default/configuration.erb +0 -0
  92. data/spec/data/checksum/random.txt +0 -1
  93. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-600hhz-0 +0 -1
  94. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-6m8zdk-0 +0 -0
  95. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ahd2gq-0 +0 -1
  96. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-api8ux-0 +0 -1
  97. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-b0r1m1-0 +0 -1
  98. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-bfygsi-0 +0 -1
  99. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-el14l6-0 +0 -1
  100. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ivrl3y-0 +0 -1
  101. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-kkbs85-0 +0 -1
  102. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ory1ux-0 +0 -1
  103. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-pgsq76-0 +0 -1
  104. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ra8uim-0 +0 -1
  105. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t7k1g-0 +0 -1
  106. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-t8g0sv-0 +0 -1
  107. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-ufy6g3-0 +0 -1
  108. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-x2d6j9-0 +0 -1
  109. data/spec/data/checksum_cache/chef-file--tmp-chef-rendered-template20100929-10863-xi0l6h-0 +0 -1
  110. data/spec/data/client.d_00/00-foo.rb +0 -2
  111. data/spec/data/client.d_00/01-bar.rb +0 -1
  112. data/spec/data/client.d_00/02-strings.rb +0 -2
  113. data/spec/data/client.d_00/bar +0 -1
  114. data/spec/data/client.d_01/foo/bar.rb +0 -1
  115. data/spec/data/client.d_02/foo.rb/foo.txt +0 -1
  116. data/spec/data/config.rb +0 -6
  117. data/spec/data/cookbooks/angrybash/metadata.rb +0 -2
  118. data/spec/data/cookbooks/angrybash/recipes/default.rb +0 -8
  119. data/spec/data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +0 -2
  120. data/spec/data/cookbooks/apache2/metadata.json +0 -33
  121. data/spec/data/cookbooks/apache2/metadata.rb +0 -2
  122. data/spec/data/cookbooks/apache2/recipes/default.rb +0 -3
  123. data/spec/data/cookbooks/borken/metadata.rb +0 -2
  124. data/spec/data/cookbooks/borken/recipes/default.rb +0 -2
  125. data/spec/data/cookbooks/borken/templates/default/borken.erb +0 -2
  126. data/spec/data/cookbooks/chefignore +0 -8
  127. data/spec/data/cookbooks/ignorken/files/default/not_me.rb +0 -2
  128. data/spec/data/cookbooks/ignorken/metadata.rb +0 -2
  129. data/spec/data/cookbooks/ignorken/recipes/default.rb +0 -1
  130. data/spec/data/cookbooks/ignorken/recipes/ignoreme.rb +0 -2
  131. data/spec/data/cookbooks/ignorken/templates/ubuntu-12.10/not_me.rb +0 -2
  132. data/spec/data/cookbooks/irssi/files/default/irssi.response +0 -2
  133. data/spec/data/cookbooks/java/files/default/java.response +0 -2
  134. data/spec/data/cookbooks/java/metadata.json +0 -33
  135. data/spec/data/cookbooks/java/metadata.rb +0 -2
  136. data/spec/data/cookbooks/name-mismatch-versionnumber/README.md +0 -4
  137. data/spec/data/cookbooks/name-mismatch-versionnumber/metadata.rb +0 -8
  138. data/spec/data/cookbooks/name-mismatch-versionnumber/recipes/default.rb +0 -8
  139. data/spec/data/cookbooks/openldap/.root_dotfile +0 -0
  140. data/spec/data/cookbooks/openldap/attributes/default.rb +0 -16
  141. data/spec/data/cookbooks/openldap/attributes/smokey.rb +0 -1
  142. data/spec/data/cookbooks/openldap/definitions/client.rb +0 -5
  143. data/spec/data/cookbooks/openldap/definitions/server.rb +0 -5
  144. data/spec/data/cookbooks/openldap/files/default/.dotfile +0 -1
  145. data/spec/data/cookbooks/openldap/files/default/.ssh/id_rsa +0 -1
  146. data/spec/data/cookbooks/openldap/files/default/remotedir/.a_dotdir/.a_dotfile_in_a_dotdir +0 -1
  147. data/spec/data/cookbooks/openldap/files/default/remotedir/not_a_template.erb +0 -2
  148. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file1.txt +0 -3
  149. data/spec/data/cookbooks/openldap/files/default/remotedir/remote_dir_file2.txt +0 -3
  150. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/.a_dotfile +0 -1
  151. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file1.txt +0 -3
  152. data/spec/data/cookbooks/openldap/files/default/remotedir/remotesubdir/remote_subdir_file2.txt +0 -3
  153. data/spec/data/cookbooks/openldap/files/default/remotedir/subdir_with_no_file_just_a_subsubdir/the_subsubdir/some_file.txt +0 -3
  154. data/spec/data/cookbooks/openldap/libraries/openldap/version.rb +0 -3
  155. data/spec/data/cookbooks/openldap/libraries/openldap.rb +0 -4
  156. data/spec/data/cookbooks/openldap/metadata.rb +0 -8
  157. data/spec/data/cookbooks/openldap/recipes/default.rb +0 -4
  158. data/spec/data/cookbooks/openldap/recipes/gigantor.rb +0 -3
  159. data/spec/data/cookbooks/openldap/recipes/one.rb +0 -15
  160. data/spec/data/cookbooks/openldap/recipes/return.rb +0 -2
  161. data/spec/data/cookbooks/openldap/spec/spec_helper.rb +0 -0
  162. data/spec/data/cookbooks/openldap/templates/default/all_windows_line_endings.erb +0 -4
  163. data/spec/data/cookbooks/openldap/templates/default/helper_test.erb +0 -1
  164. data/spec/data/cookbooks/openldap/templates/default/helpers.erb +0 -14
  165. data/spec/data/cookbooks/openldap/templates/default/helpers_via_partial_test.erb +0 -1
  166. data/spec/data/cookbooks/openldap/templates/default/nested_openldap_partials.erb +0 -1
  167. data/spec/data/cookbooks/openldap/templates/default/nested_partial.erb +0 -1
  168. data/spec/data/cookbooks/openldap/templates/default/no_windows_line_endings.erb +0 -4
  169. data/spec/data/cookbooks/openldap/templates/default/openldap_nested_variable_stuff.erb +0 -1
  170. data/spec/data/cookbooks/openldap/templates/default/openldap_stuff.conf.erb +0 -1
  171. data/spec/data/cookbooks/openldap/templates/default/openldap_variable_stuff.conf.erb +0 -1
  172. data/spec/data/cookbooks/openldap/templates/default/some_windows_line_endings.erb +0 -4
  173. data/spec/data/cookbooks/openldap/templates/default/test.erb +0 -1
  174. data/spec/data/cookbooks/preseed/files/default/preseed-file.seed +0 -1
  175. data/spec/data/cookbooks/preseed/files/default/preseed-template.seed +0 -4
  176. data/spec/data/cookbooks/preseed/metadata.rb +0 -2
  177. data/spec/data/cookbooks/preseed/templates/default/preseed-template-variables.seed +0 -1
  178. data/spec/data/cookbooks/preseed/templates/default/preseed-template.seed +0 -1
  179. data/spec/data/cookbooks/starter/chefignore +0 -8
  180. data/spec/data/cookbooks/starter/files/sample.txt +0 -1
  181. data/spec/data/cookbooks/starter/metadata.rb +0 -2
  182. data/spec/data/cookbooks/starter/recipes/default.rb +0 -4
  183. data/spec/data/cookbooks/supports-platform-constraints/metadata.rb +0 -5
  184. data/spec/data/cookbooks/wget/files/default/wget.response +0 -2
  185. data/spec/data/definitions/test.rb +0 -5
  186. data/spec/data/dsc_lcm.pfx +0 -0
  187. data/spec/data/environment-config.rb +0 -5
  188. data/spec/data/file-providers-method-snapshot-chef-11-4.json +0 -127
  189. data/spec/data/fileedit/blank +0 -0
  190. data/spec/data/fileedit/hosts +0 -4
  191. data/spec/data/gems/chef-integration-test-0.1.0.gem +0 -0
  192. data/spec/data/git_bundles/example-repo.gitbundle +0 -0
  193. data/spec/data/git_bundles/sinatra-test-app-with-callback-files.gitbundle +0 -0
  194. data/spec/data/git_bundles/sinatra-test-app-with-symlinks.gitbundle +0 -0
  195. data/spec/data/git_bundles/sinatra-test-app.gitbundle +0 -0
  196. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/README.md +0 -4
  197. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/metadata.rb +0 -13
  198. data/spec/data/incomplete-metadata-chef-repo/incomplete-metadata/recipes/default.rb +0 -8
  199. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/README.md +0 -4
  200. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/metadata.rb +0 -9
  201. data/spec/data/invalid-metadata-chef-repo/invalid-metadata/recipes/default.rb +0 -8
  202. data/spec/data/kitchen/chefignore +0 -6
  203. data/spec/data/kitchen/openldap/attributes/default.rb +0 -3
  204. data/spec/data/kitchen/openldap/attributes/robinson.rb +0 -3
  205. data/spec/data/kitchen/openldap/definitions/client.rb +0 -3
  206. data/spec/data/kitchen/openldap/definitions/drewbarrymore.rb +0 -3
  207. data/spec/data/kitchen/openldap/recipes/gigantor.rb +0 -3
  208. data/spec/data/kitchen/openldap/recipes/ignoreme.rb +0 -3
  209. data/spec/data/kitchen/openldap/recipes/woot.rb +0 -3
  210. data/spec/data/knife-home/.chef/plugins/knife/example_home_subcommand.rb +0 -0
  211. data/spec/data/knife-site-subcommands/plugins/knife/example_subcommand.rb +0 -0
  212. data/spec/data/knife_subcommand/test_explicit_category.rb +0 -7
  213. data/spec/data/knife_subcommand/test_name_mapping.rb +0 -4
  214. data/spec/data/knife_subcommand/test_yourself.rb +0 -21
  215. data/spec/data/lwrp/providers/buck_passer.rb +0 -28
  216. data/spec/data/lwrp/providers/buck_passer_2.rb +0 -26
  217. data/spec/data/lwrp/providers/embedded_resource_accesses_providers_scope.rb +0 -28
  218. data/spec/data/lwrp/providers/inline_compiler.rb +0 -24
  219. data/spec/data/lwrp/providers/monkey_name_printer.rb +0 -5
  220. data/spec/data/lwrp/providers/paint_drying_watcher.rb +0 -7
  221. data/spec/data/lwrp/providers/thumb_twiddler.rb +0 -7
  222. data/spec/data/lwrp/resources/bar.rb +0 -4
  223. data/spec/data/lwrp/resources/buck_passer.rb +0 -6
  224. data/spec/data/lwrp/resources/buck_passer_2.rb +0 -4
  225. data/spec/data/lwrp/resources/embedded_resource_accesses_providers_scope.rb +0 -4
  226. data/spec/data/lwrp/resources/foo.rb +0 -6
  227. data/spec/data/lwrp/resources/inline_compiler.rb +0 -4
  228. data/spec/data/lwrp/resources/monkey_name_printer.rb +0 -6
  229. data/spec/data/lwrp/resources/paint_drying_watcher.rb +0 -4
  230. data/spec/data/lwrp/resources/thumb_twiddler.rb +0 -4
  231. data/spec/data/lwrp/resources_with_default_attributes/nodeattr.rb +0 -3
  232. data/spec/data/lwrp_const_scoping/resources/conflict.rb +0 -1
  233. data/spec/data/lwrp_override/providers/buck_passer.rb +0 -5
  234. data/spec/data/lwrp_override/resources/foo.rb +0 -11
  235. data/spec/data/mac_users/10.9.plist.xml +0 -560
  236. data/spec/data/mac_users/10.9.shadow.xml +0 -21
  237. data/spec/data/metadata/quick_start/metadata.rb +0 -14
  238. data/spec/data/mixin/invalid_data.rb +0 -3
  239. data/spec/data/mixin/real_data.rb +0 -2
  240. data/spec/data/nested.json +0 -2
  241. data/spec/data/nodes/default.rb +0 -15
  242. data/spec/data/nodes/test.example.com.rb +0 -17
  243. data/spec/data/nodes/test.rb +0 -15
  244. data/spec/data/null_config.rb +0 -1
  245. data/spec/data/object_loader/environments/test.json +0 -7
  246. data/spec/data/object_loader/environments/test.rb +0 -2
  247. data/spec/data/object_loader/environments/test_json_class.json +0 -8
  248. data/spec/data/object_loader/nodes/test.json +0 -7
  249. data/spec/data/object_loader/nodes/test.rb +0 -2
  250. data/spec/data/object_loader/nodes/test_json_class.json +0 -8
  251. data/spec/data/object_loader/roles/test.json +0 -7
  252. data/spec/data/object_loader/roles/test.rb +0 -2
  253. data/spec/data/object_loader/roles/test_json_class.json +0 -8
  254. data/spec/data/old_home_dir/my-dot-emacs +0 -0
  255. data/spec/data/old_home_dir/my-dot-vim +0 -0
  256. data/spec/data/partial_one.erb +0 -1
  257. data/spec/data/prefer_metadata_json/metadata.json +0 -51
  258. data/spec/data/prefer_metadata_json/metadata.rb +0 -6
  259. data/spec/data/prefer_metadata_json/recipes/default.rb +0 -0
  260. data/spec/data/recipes/test.rb +0 -7
  261. data/spec/data/recipes.tgz +0 -0
  262. data/spec/data/remote_directory_data/remote_dir_file.txt +0 -1
  263. data/spec/data/remote_directory_data/remote_subdirectory/remote_subdir_file.txt +0 -1
  264. data/spec/data/remote_file/nyan_cat.png +0 -0
  265. data/spec/data/remote_file/nyan_cat.png.gz +0 -0
  266. data/spec/data/root_alias_cookbooks/dup_attr/attributes/default.rb +0 -1
  267. data/spec/data/root_alias_cookbooks/dup_attr/attributes.rb +0 -1
  268. data/spec/data/root_alias_cookbooks/dup_attr/metadata.rb +0 -2
  269. data/spec/data/root_alias_cookbooks/dup_attr/recipe.rb +0 -3
  270. data/spec/data/root_alias_cookbooks/dup_recipe/attributes.rb +0 -1
  271. data/spec/data/root_alias_cookbooks/dup_recipe/metadata.rb +0 -2
  272. data/spec/data/root_alias_cookbooks/dup_recipe/recipe.rb +0 -3
  273. data/spec/data/root_alias_cookbooks/dup_recipe/recipes/default.rb +0 -3
  274. data/spec/data/root_alias_cookbooks/simple/attributes.rb +0 -1
  275. data/spec/data/root_alias_cookbooks/simple/metadata.rb +0 -2
  276. data/spec/data/root_alias_cookbooks/simple/recipe.rb +0 -3
  277. data/spec/data/rubygems.org/latest_specs.4.8.gz +0 -0
  278. data/spec/data/rubygems.org/nonexistent_gem +0 -0
  279. data/spec/data/rubygems.org/nonexistent_gem-info +0 -1
  280. data/spec/data/rubygems.org/sexp_processor +0 -0
  281. data/spec/data/rubygems.org/sexp_processor-4.15.1.gemspec.rz +0 -0
  282. data/spec/data/rubygems.org/sexp_processor-info +0 -50
  283. data/spec/data/run_context/cookbooks/circular-dep1/attributes/default.rb +0 -2
  284. data/spec/data/run_context/cookbooks/circular-dep1/definitions/circular_dep1_res.rb +0 -1
  285. data/spec/data/run_context/cookbooks/circular-dep1/libraries/lib.rb +0 -2
  286. data/spec/data/run_context/cookbooks/circular-dep1/metadata.rb +0 -2
  287. data/spec/data/run_context/cookbooks/circular-dep1/providers/provider.rb +0 -1
  288. data/spec/data/run_context/cookbooks/circular-dep1/recipes/default.rb +0 -0
  289. data/spec/data/run_context/cookbooks/circular-dep1/resources/resource.rb +0 -2
  290. data/spec/data/run_context/cookbooks/circular-dep2/attributes/default.rb +0 -2
  291. data/spec/data/run_context/cookbooks/circular-dep2/definitions/circular_dep2_res.rb +0 -1
  292. data/spec/data/run_context/cookbooks/circular-dep2/libraries/lib.rb +0 -2
  293. data/spec/data/run_context/cookbooks/circular-dep2/metadata.rb +0 -2
  294. data/spec/data/run_context/cookbooks/circular-dep2/providers/provider.rb +0 -1
  295. data/spec/data/run_context/cookbooks/circular-dep2/recipes/default.rb +0 -0
  296. data/spec/data/run_context/cookbooks/circular-dep2/resources/resource.rb +0 -2
  297. data/spec/data/run_context/cookbooks/dependency1/attributes/aa_first.rb +0 -2
  298. data/spec/data/run_context/cookbooks/dependency1/attributes/default.rb +0 -2
  299. data/spec/data/run_context/cookbooks/dependency1/attributes/unparsed_file +0 -1
  300. data/spec/data/run_context/cookbooks/dependency1/attributes/zz_last.rb +0 -2
  301. data/spec/data/run_context/cookbooks/dependency1/definitions/dependency1_res.rb +0 -1
  302. data/spec/data/run_context/cookbooks/dependency1/definitions/unparsed_file +0 -1
  303. data/spec/data/run_context/cookbooks/dependency1/libraries/lib.rb +0 -2
  304. data/spec/data/run_context/cookbooks/dependency1/libraries/unparsed_file +0 -1
  305. data/spec/data/run_context/cookbooks/dependency1/providers/provider.rb +0 -1
  306. data/spec/data/run_context/cookbooks/dependency1/providers/unparsed_file +0 -1
  307. data/spec/data/run_context/cookbooks/dependency1/recipes/default.rb +0 -0
  308. data/spec/data/run_context/cookbooks/dependency1/recipes/unparsed_file +0 -1
  309. data/spec/data/run_context/cookbooks/dependency1/resources/resource.rb +0 -2
  310. data/spec/data/run_context/cookbooks/dependency1/resources/unparsed_file +0 -1
  311. data/spec/data/run_context/cookbooks/dependency2/attributes/default.rb +0 -2
  312. data/spec/data/run_context/cookbooks/dependency2/definitions/dependency2_res.rb +0 -1
  313. data/spec/data/run_context/cookbooks/dependency2/libraries/lib.rb +0 -2
  314. data/spec/data/run_context/cookbooks/dependency2/providers/provider.rb +0 -1
  315. data/spec/data/run_context/cookbooks/dependency2/recipes/default.rb +0 -0
  316. data/spec/data/run_context/cookbooks/dependency2/resources/resource.rb +0 -2
  317. data/spec/data/run_context/cookbooks/include/recipes/default.rb +0 -24
  318. data/spec/data/run_context/cookbooks/include/recipes/includee.rb +0 -3
  319. data/spec/data/run_context/cookbooks/no-default-attr/attributes/server.rb +0 -2
  320. data/spec/data/run_context/cookbooks/no-default-attr/definitions/no_default-attr_res.rb +0 -1
  321. data/spec/data/run_context/cookbooks/no-default-attr/providers/provider.rb +0 -1
  322. data/spec/data/run_context/cookbooks/no-default-attr/recipes/default.rb +0 -0
  323. data/spec/data/run_context/cookbooks/no-default-attr/resources/resource.rb +0 -2
  324. data/spec/data/run_context/cookbooks/test/attributes/default.rb +0 -0
  325. data/spec/data/run_context/cookbooks/test/attributes/george.rb +0 -1
  326. data/spec/data/run_context/cookbooks/test/definitions/new_animals.rb +0 -9
  327. data/spec/data/run_context/cookbooks/test/definitions/new_cat.rb +0 -5
  328. data/spec/data/run_context/cookbooks/test/definitions/test_res.rb +0 -1
  329. data/spec/data/run_context/cookbooks/test/providers/provider.rb +0 -1
  330. data/spec/data/run_context/cookbooks/test/recipes/default.rb +0 -5
  331. data/spec/data/run_context/cookbooks/test/recipes/one.rb +0 -7
  332. data/spec/data/run_context/cookbooks/test/recipes/two.rb +0 -7
  333. data/spec/data/run_context/cookbooks/test/resources/resource.rb +0 -3
  334. data/spec/data/run_context/cookbooks/test-with-circular-deps/attributes/default.rb +0 -2
  335. data/spec/data/run_context/cookbooks/test-with-circular-deps/definitions/test_with-circular-deps_res.rb +0 -1
  336. data/spec/data/run_context/cookbooks/test-with-circular-deps/libraries/lib.rb +0 -2
  337. data/spec/data/run_context/cookbooks/test-with-circular-deps/metadata.rb +0 -2
  338. data/spec/data/run_context/cookbooks/test-with-circular-deps/providers/provider.rb +0 -1
  339. data/spec/data/run_context/cookbooks/test-with-circular-deps/recipes/default.rb +0 -0
  340. data/spec/data/run_context/cookbooks/test-with-circular-deps/resources/resource.rb +0 -3
  341. data/spec/data/run_context/cookbooks/test-with-deps/attributes/default.rb +0 -2
  342. data/spec/data/run_context/cookbooks/test-with-deps/definitions/test_with-deps_res.rb +0 -1
  343. data/spec/data/run_context/cookbooks/test-with-deps/libraries/lib.rb +0 -1
  344. data/spec/data/run_context/cookbooks/test-with-deps/metadata.rb +0 -3
  345. data/spec/data/run_context/cookbooks/test-with-deps/providers/provider.rb +0 -1
  346. data/spec/data/run_context/cookbooks/test-with-deps/recipes/default.rb +0 -0
  347. data/spec/data/run_context/cookbooks/test-with-deps/recipes/server.rb +0 -0
  348. data/spec/data/run_context/cookbooks/test-with-deps/resources/resource.rb +0 -2
  349. data/spec/data/run_context/nodes/run_context.rb +0 -5
  350. data/spec/data/sample_msu1.xml +0 -10
  351. data/spec/data/sample_msu2.xml +0 -14
  352. data/spec/data/sample_msu3.xml +0 -16
  353. data/spec/data/search_queries_to_transform.txt +0 -98
  354. data/spec/data/shef-config.rb +0 -11
  355. data/spec/data/snap_package/async_result_success.json +0 -6
  356. data/spec/data/snap_package/change_id_result.json +0 -175
  357. data/spec/data/snap_package/find_result_failure.json +0 -10
  358. data/spec/data/snap_package/find_result_success.json +0 -70
  359. data/spec/data/snap_package/get_by_name_result_failure.json +0 -10
  360. data/spec/data/snap_package/get_by_name_result_success.json +0 -38
  361. data/spec/data/snap_package/get_conf_success.json +0 -10
  362. data/spec/data/snap_package/result_failure.json +0 -9
  363. data/spec/data/ssl/5e707473.0 +0 -18
  364. data/spec/data/ssl/binary/chef-rspec-der.cert +0 -0
  365. data/spec/data/ssl/binary/chef-rspec-der.key +0 -0
  366. data/spec/data/ssl/chef-rspec.cert +0 -27
  367. data/spec/data/ssl/chef-rspec.key +0 -27
  368. data/spec/data/ssl/key.pem +0 -15
  369. data/spec/data/ssl/private_key.pem +0 -27
  370. data/spec/data/ssl/private_key_with_whitespace.pem +0 -32
  371. data/spec/data/standalone_cookbook/Gemfile +0 -1
  372. data/spec/data/standalone_cookbook/chefignore +0 -9
  373. data/spec/data/standalone_cookbook/recipes/default.rb +0 -3
  374. data/spec/data/standalone_cookbook/vendor/bundle/ruby/2.0.0/gems/multi_json-1.9.0/lib/multi_json.rb +0 -1
  375. data/spec/data/templates/chef-seattle20160930-4388-1crv7ef.txt +0 -1
  376. data/spec/data/templates/chef-seattle20160930-4388-jjfoae.txt +0 -1
  377. data/spec/data/templates/chef-seattle20160930-4388-umeq2c.txt +0 -1
  378. data/spec/data/templates/failed.erb +0 -5
  379. data/spec/data/templates/seattle.txt +0 -1
  380. data/spec/data/trusted_certs/example.crt +0 -31
  381. data/spec/data/trusted_certs/example_no_cn.crt +0 -32
  382. data/spec/data/trusted_certs/intermediate.pem +0 -38
  383. data/spec/data/trusted_certs/opscode.pem +0 -36
  384. data/spec/data/trusted_certs/root.pem +0 -22
  385. data/spec/data/windows_certificates/base64_test.cer +0 -20
  386. data/spec/data/windows_certificates/othertest.cer +0 -20
  387. data/spec/data/windows_certificates/test.cer +0 -20
  388. data/spec/data/windows_certificates/test.p7b +0 -0
  389. data/spec/data/windows_certificates/test.pem +0 -20
  390. data/spec/data/windows_certificates/test.pfx +0 -0
  391. data/spec/functional/application_spec.rb +0 -58
  392. data/spec/functional/assets/PkgA.1.0.0.0.bff +0 -0
  393. data/spec/functional/assets/PkgA.2.0.0.0.bff +0 -0
  394. data/spec/functional/assets/chefinittest +0 -36
  395. data/spec/functional/assets/chocolatey_feed/test-A.1.0.0.nupkg +0 -0
  396. data/spec/functional/assets/chocolatey_feed/test-A.1.5.0.nupkg +0 -0
  397. data/spec/functional/assets/chocolatey_feed/test-A.2.0.0.nupkg +0 -0
  398. data/spec/functional/assets/chocolatey_feed/test-B.1.0.0.nupkg +0 -0
  399. data/spec/functional/assets/dummy-1-0.aix6.1.noarch.rpm +0 -0
  400. data/spec/functional/assets/dummy-2-0.aix6.1.noarch.rpm +0 -0
  401. data/spec/functional/assets/inittest +0 -37
  402. data/spec/functional/assets/mytest-1.0-1.noarch.rpm +0 -0
  403. data/spec/functional/assets/mytest-2.0-1.noarch.rpm +0 -0
  404. data/spec/functional/assets/testchefsubsys +0 -10
  405. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.aarch64.rpm +0 -0
  406. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.i686.rpm +0 -0
  407. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.ppc64.rpm +0 -0
  408. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.ppc64le.rpm +0 -0
  409. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.s390x.rpm +0 -0
  410. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.src.rpm +0 -0
  411. data/spec/functional/assets/yumrepo/chef_rpm-1.10-1.x86_64.rpm +0 -0
  412. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.aarch64.rpm +0 -0
  413. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.i686.rpm +0 -0
  414. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.ppc64.rpm +0 -0
  415. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.ppc64le.rpm +0 -0
  416. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.s390x.rpm +0 -0
  417. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.src.rpm +0 -0
  418. data/spec/functional/assets/yumrepo/chef_rpm-1.2-1.x86_64.rpm +0 -0
  419. data/spec/functional/assets/yumrepo/repodata/4632d67cb92636e7575d911c24f0e04d3505a944e97c483abe0c3e73a7c62d33-filelists.sqlite.bz2 +0 -0
  420. data/spec/functional/assets/yumrepo/repodata/74599b793e54d877323837d2d81a1c3c594c44e4335f9528234bb490f7b9b439-other.xml.gz +0 -0
  421. data/spec/functional/assets/yumrepo/repodata/a845d418f919d2115ab95a56b2c76f6825ad0d0bede49181a55c04f58995d057-primary.sqlite.bz2 +0 -0
  422. data/spec/functional/assets/yumrepo/repodata/af9b7cf9ef23bd7b43068d74a460f3b5d06753d638e58e4a0c9edc35bfb9cdc4-other.sqlite.bz2 +0 -0
  423. data/spec/functional/assets/yumrepo/repodata/bdb4f5f1492a3b9532f22c43110a81500dd744f23da0aec5c33b2a41317c737d-filelists.xml.gz +0 -0
  424. data/spec/functional/assets/yumrepo/repodata/c10d1d34ce99e02f12ec96ef68360543ab1bb7c3cb81a4a2bf78df7d8597e9df-primary.xml.gz +0 -0
  425. data/spec/functional/assets/yumrepo/repodata/filelists.xml.gz +0 -0
  426. data/spec/functional/assets/yumrepo/repodata/other.xml.gz +0 -0
  427. data/spec/functional/assets/yumrepo/repodata/primary.xml.gz +0 -0
  428. data/spec/functional/assets/yumrepo/repodata/repomd.xml +0 -21
  429. data/spec/functional/assets/yumrepo-empty/repodata/01a3b-filelists.sqlite.bz2 +0 -0
  430. data/spec/functional/assets/yumrepo-empty/repodata/401dc-filelists.xml.gz +0 -0
  431. data/spec/functional/assets/yumrepo-empty/repodata/5dc1e-primary.sqlite.bz2 +0 -0
  432. data/spec/functional/assets/yumrepo-empty/repodata/6bf96-other.xml.gz +0 -0
  433. data/spec/functional/assets/yumrepo-empty/repodata/7c365-other.sqlite.bz2 +0 -0
  434. data/spec/functional/assets/yumrepo-empty/repodata/dabe2-primary.xml.gz +0 -0
  435. data/spec/functional/assets/yumrepo-empty/repodata/repomd.xml +0 -55
  436. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.aarch64.rpm +0 -0
  437. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.i686.rpm +0 -0
  438. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.ppc64.rpm +0 -0
  439. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.ppc64le.rpm +0 -0
  440. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.s390x.rpm +0 -0
  441. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.src.rpm +0 -0
  442. data/spec/functional/assets/zypprepo/chef_rpm-1.10-1.x86_64.rpm +0 -0
  443. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.aarch64.rpm +0 -0
  444. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.i686.rpm +0 -0
  445. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.ppc64.rpm +0 -0
  446. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.ppc64le.rpm +0 -0
  447. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.s390x.rpm +0 -0
  448. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.src.rpm +0 -0
  449. data/spec/functional/assets/zypprepo/chef_rpm-1.2-1.x86_64.rpm +0 -0
  450. data/spec/functional/dsl/reboot_pending_spec.rb +0 -88
  451. data/spec/functional/dsl/registry_helper_spec.rb +0 -61
  452. data/spec/functional/event_loggers/windows_eventlog_spec.rb +0 -107
  453. data/spec/functional/file_content_management/deploy_strategies_spec.rb +0 -229
  454. data/spec/functional/http/simple_spec.rb +0 -146
  455. data/spec/functional/mixin/from_file_spec.rb +0 -93
  456. data/spec/functional/mixin/powershell_out_spec.rb +0 -51
  457. data/spec/functional/mixin/shell_out_spec.rb +0 -48
  458. data/spec/functional/mixin/user_context_spec.rb +0 -119
  459. data/spec/functional/notifications_spec.rb +0 -238
  460. data/spec/functional/provider/remote_file/cache_control_data_spec.rb +0 -100
  461. data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +0 -51
  462. data/spec/functional/rebooter_spec.rb +0 -117
  463. data/spec/functional/resource/aix_service_spec.rb +0 -145
  464. data/spec/functional/resource/aixinit_service_spec.rb +0 -210
  465. data/spec/functional/resource/apt_package_spec.rb +0 -383
  466. data/spec/functional/resource/archive_file_spec.rb +0 -88
  467. data/spec/functional/resource/bash_spec.rb +0 -55
  468. data/spec/functional/resource/batch_spec.rb +0 -34
  469. data/spec/functional/resource/bff_spec.rb +0 -120
  470. data/spec/functional/resource/chocolatey_package_spec.rb +0 -194
  471. data/spec/functional/resource/cookbook_file_spec.rb +0 -79
  472. data/spec/functional/resource/cron_spec.rb +0 -179
  473. data/spec/functional/resource/directory_spec.rb +0 -43
  474. data/spec/functional/resource/dnf_package_spec.rb +0 -1629
  475. data/spec/functional/resource/dpkg_package_spec.rb +0 -355
  476. data/spec/functional/resource/dsc_resource_spec.rb +0 -91
  477. data/spec/functional/resource/dsc_script_spec.rb +0 -476
  478. data/spec/functional/resource/execute_spec.rb +0 -171
  479. data/spec/functional/resource/file_spec.rb +0 -167
  480. data/spec/functional/resource/git_spec.rb +0 -330
  481. data/spec/functional/resource/group_spec.rb +0 -486
  482. data/spec/functional/resource/ifconfig_spec.rb +0 -178
  483. data/spec/functional/resource/insserv_spec.rb +0 -206
  484. data/spec/functional/resource/launchd_spec.rb +0 -232
  485. data/spec/functional/resource/link_spec.rb +0 -704
  486. data/spec/functional/resource/locale_spec.rb +0 -108
  487. data/spec/functional/resource/macos_userdefaults_spec.rb +0 -139
  488. data/spec/functional/resource/mount_spec.rb +0 -219
  489. data/spec/functional/resource/msu_package_spec.rb +0 -107
  490. data/spec/functional/resource/ohai_spec.rb +0 -54
  491. data/spec/functional/resource/plist_spec.rb +0 -25
  492. data/spec/functional/resource/powershell_package_source_spec.rb +0 -106
  493. data/spec/functional/resource/powershell_script_spec.rb +0 -588
  494. data/spec/functional/resource/reboot_spec.rb +0 -103
  495. data/spec/functional/resource/registry_spec.rb +0 -300
  496. data/spec/functional/resource/remote_directory_spec.rb +0 -220
  497. data/spec/functional/resource/remote_file_spec.rb +0 -418
  498. data/spec/functional/resource/rpm_spec.rb +0 -120
  499. data/spec/functional/resource/template_spec.rb +0 -245
  500. data/spec/functional/resource/timezone_spec.rb +0 -41
  501. data/spec/functional/resource/user/linux_user_spec.rb +0 -127
  502. data/spec/functional/resource/user/mac_user_spec.rb +0 -207
  503. data/spec/functional/resource/user/windows_spec.rb +0 -245
  504. data/spec/functional/resource/windows_certificate_spec.rb +0 -401
  505. data/spec/functional/resource/windows_env_spec.rb +0 -285
  506. data/spec/functional/resource/windows_firewall_rule_spec.rb +0 -93
  507. data/spec/functional/resource/windows_font_spec.rb +0 -52
  508. data/spec/functional/resource/windows_hostname_spec.rb +0 -91
  509. data/spec/functional/resource/windows_package_spec.rb +0 -193
  510. data/spec/functional/resource/windows_pagefile_spec.rb +0 -125
  511. data/spec/functional/resource/windows_path_spec.rb +0 -68
  512. data/spec/functional/resource/windows_security_policy_spec.rb +0 -86
  513. data/spec/functional/resource/windows_share_spec.rb +0 -103
  514. data/spec/functional/resource/windows_task_spec.rb +0 -1969
  515. data/spec/functional/resource/windows_user_privilege_spec.rb +0 -192
  516. data/spec/functional/resource/yum_package_spec.rb +0 -1739
  517. data/spec/functional/resource/zypper_package_spec.rb +0 -276
  518. data/spec/functional/root_alias_spec.rb +0 -78
  519. data/spec/functional/run_lock_spec.rb +0 -481
  520. data/spec/functional/shell_spec.rb +0 -149
  521. data/spec/functional/tiny_server_spec.rb +0 -79
  522. data/spec/functional/util/path_helper_spec.rb +0 -37
  523. data/spec/functional/version_spec.rb +0 -36
  524. data/spec/functional/win32/crypto_spec.rb +0 -54
  525. data/spec/functional/win32/registry_spec.rb +0 -618
  526. data/spec/functional/win32/security_spec.rb +0 -233
  527. data/spec/functional/win32/sid_spec.rb +0 -55
  528. data/spec/functional/win32/version_info_spec.rb +0 -50
  529. data/spec/functional/win32/versions_spec.rb +0 -115
  530. data/spec/integration/client/client_spec.rb +0 -963
  531. data/spec/integration/client/exit_code_spec.rb +0 -116
  532. data/spec/integration/client/fips_spec.rb +0 -29
  533. data/spec/integration/client/ipv6_spec.rb +0 -135
  534. data/spec/integration/client/open_ssl_spec.rb +0 -25
  535. data/spec/integration/compliance/compliance_spec.rb +0 -143
  536. data/spec/integration/ohai/ohai_spec.rb +0 -62
  537. data/spec/integration/recipes/accumulator_spec.rb +0 -245
  538. data/spec/integration/recipes/lwrp_inline_resources_spec.rb +0 -176
  539. data/spec/integration/recipes/lwrp_spec.rb +0 -56
  540. data/spec/integration/recipes/noop_resource_spec.rb +0 -24
  541. data/spec/integration/recipes/notifies_spec.rb +0 -438
  542. data/spec/integration/recipes/notifying_block_spec.rb +0 -116
  543. data/spec/integration/recipes/provider_choice.rb +0 -38
  544. data/spec/integration/recipes/recipe_dsl_spec.rb +0 -1281
  545. data/spec/integration/recipes/remote_directory.rb +0 -74
  546. data/spec/integration/recipes/resource_action_spec.rb +0 -524
  547. data/spec/integration/recipes/resource_converge_if_changed_spec.rb +0 -554
  548. data/spec/integration/recipes/resource_load_spec.rb +0 -315
  549. data/spec/integration/recipes/unified_mode_spec.rb +0 -947
  550. data/spec/integration/recipes/use_partial_spec.rb +0 -116
  551. data/spec/integration/solo/solo_spec.rb +0 -219
  552. data/spec/rcov.opts +0 -2
  553. data/spec/spec_helper.rb +0 -350
  554. data/spec/stress/win32/file_spec.rb +0 -37
  555. data/spec/stress/win32/memory_spec.rb +0 -22
  556. data/spec/stress/win32/security_spec.rb +0 -69
  557. data/spec/support/chef_helpers.rb +0 -79
  558. data/spec/support/key_helpers.rb +0 -102
  559. data/spec/support/lib/chef/provider/easy.rb +0 -35
  560. data/spec/support/lib/chef/provider/openldap_includer.rb +0 -29
  561. data/spec/support/lib/chef/provider/snakeoil.rb +0 -42
  562. data/spec/support/lib/chef/resource/cat.rb +0 -39
  563. data/spec/support/lib/chef/resource/one_two_three_four.rb +0 -36
  564. data/spec/support/lib/chef/resource/openldap_includer.rb +0 -28
  565. data/spec/support/lib/chef/resource/with_state.rb +0 -29
  566. data/spec/support/lib/chef/resource/zen_follower.rb +0 -36
  567. data/spec/support/lib/chef/resource/zen_master.rb +0 -39
  568. data/spec/support/lib/library_load_order.rb +0 -20
  569. data/spec/support/matchers/leak.rb +0 -96
  570. data/spec/support/mock/platform.rb +0 -33
  571. data/spec/support/platform_helpers.rb +0 -284
  572. data/spec/support/platforms/prof/gc.rb +0 -51
  573. data/spec/support/platforms/prof/win32.rb +0 -45
  574. data/spec/support/platforms/win32/spec_service.rb +0 -57
  575. data/spec/support/recipe_dsl_helper.rb +0 -83
  576. data/spec/support/ruby_installer.rb +0 -51
  577. data/spec/support/shared/context/config.rb +0 -18
  578. data/spec/support/shared/context/win32.rb +0 -34
  579. data/spec/support/shared/functional/diff_disabled.rb +0 -10
  580. data/spec/support/shared/functional/directory_resource.rb +0 -178
  581. data/spec/support/shared/functional/execute_resource.rb +0 -150
  582. data/spec/support/shared/functional/file_resource.rb +0 -1047
  583. data/spec/support/shared/functional/http.rb +0 -224
  584. data/spec/support/shared/functional/knife.rb +0 -37
  585. data/spec/support/shared/functional/securable_resource.rb +0 -654
  586. data/spec/support/shared/functional/securable_resource_with_reporting.rb +0 -393
  587. data/spec/support/shared/functional/windows_script.rb +0 -260
  588. data/spec/support/shared/integration/integration_helper.rb +0 -122
  589. data/spec/support/shared/integration/knife_support.rb +0 -192
  590. data/spec/support/shared/matchers/exit_with_code.rb +0 -32
  591. data/spec/support/shared/matchers/match_environment_variable.rb +0 -17
  592. data/spec/support/shared/shared_examples.rb +0 -14
  593. data/spec/support/shared/unit/api_error_inspector.rb +0 -190
  594. data/spec/support/shared/unit/api_versioning.rb +0 -77
  595. data/spec/support/shared/unit/application_dot_d.rb +0 -82
  596. data/spec/support/shared/unit/execute_resource.rb +0 -166
  597. data/spec/support/shared/unit/file_system_support.rb +0 -70
  598. data/spec/support/shared/unit/knife_shared.rb +0 -39
  599. data/spec/support/shared/unit/mock_shellout.rb +0 -49
  600. data/spec/support/shared/unit/platform_introspector.rb +0 -189
  601. data/spec/support/shared/unit/provider/file.rb +0 -877
  602. data/spec/support/shared/unit/provider/package/package_shared.rb +0 -95
  603. data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +0 -410
  604. data/spec/support/shared/unit/resource/static_provider_resolution.rb +0 -63
  605. data/spec/support/shared/unit/script_resource.rb +0 -74
  606. data/spec/support/shared/unit/user_and_client_shared.rb +0 -114
  607. data/spec/support/shared/unit/windows_script_resource.rb +0 -65
  608. data/spec/tiny_server.rb +0 -193
  609. data/spec/unit/action_collection_spec.rb +0 -19
  610. data/spec/unit/api_client/registration_spec.rb +0 -278
  611. data/spec/unit/api_client_spec.rb +0 -341
  612. data/spec/unit/api_client_v1_spec.rb +0 -455
  613. data/spec/unit/application/agent_spec.rb +0 -0
  614. data/spec/unit/application/apply_spec.rb +0 -116
  615. data/spec/unit/application/base_spec.rb +0 -40
  616. data/spec/unit/application/client_spec.rb +0 -588
  617. data/spec/unit/application/exit_code_spec.rb +0 -145
  618. data/spec/unit/application/server_spec.rb +0 -0
  619. data/spec/unit/application/solo_spec.rb +0 -218
  620. data/spec/unit/application_spec.rb +0 -587
  621. data/spec/unit/chef_class_spec.rb +0 -240
  622. data/spec/unit/chef_fs/config_spec.rb +0 -235
  623. data/spec/unit/chef_fs/data_handler/data_bag_item_data_handler.rb +0 -82
  624. data/spec/unit/chef_fs/data_handler/data_handler_base_spec.rb +0 -65
  625. data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +0 -63
  626. data/spec/unit/chef_fs/diff_spec.rb +0 -328
  627. data/spec/unit/chef_fs/file_pattern_spec.rb +0 -512
  628. data/spec/unit/chef_fs/file_system/cookbook_subdir_spec.rb +0 -34
  629. data/spec/unit/chef_fs/file_system/operation_failed_error_spec.rb +0 -45
  630. data/spec/unit/chef_fs/file_system/repository/base_file_spec.rb +0 -126
  631. data/spec/unit/chef_fs/file_system/repository/directory_spec.rb +0 -175
  632. data/spec/unit/chef_fs/file_system_spec.rb +0 -150
  633. data/spec/unit/chef_fs/path_util_spec.rb +0 -108
  634. data/spec/unit/chef_spec.rb +0 -25
  635. data/spec/unit/client_spec.rb +0 -881
  636. data/spec/unit/compliance/fetcher/automate_spec.rb +0 -126
  637. data/spec/unit/compliance/fetcher/chef_server_spec.rb +0 -93
  638. data/spec/unit/compliance/input_spec.rb +0 -104
  639. data/spec/unit/compliance/profile_spec.rb +0 -120
  640. data/spec/unit/compliance/reporter/automate_spec.rb +0 -451
  641. data/spec/unit/compliance/reporter/chef_server_automate_spec.rb +0 -197
  642. data/spec/unit/compliance/reporter/compliance_enforcer_spec.rb +0 -49
  643. data/spec/unit/compliance/runner_spec.rb +0 -354
  644. data/spec/unit/compliance/waiver_spec.rb +0 -104
  645. data/spec/unit/config_fetcher_spec.rb +0 -125
  646. data/spec/unit/config_spec.rb +0 -31
  647. data/spec/unit/cookbook/chefignore_spec.rb +0 -69
  648. data/spec/unit/cookbook/cookbook_version_loader_spec.rb +0 -213
  649. data/spec/unit/cookbook/file_vendor_spec.rb +0 -123
  650. data/spec/unit/cookbook/gem_installer_spec.rb +0 -114
  651. data/spec/unit/cookbook/manifest_v0_spec.rb +0 -133
  652. data/spec/unit/cookbook/manifest_v2_spec.rb +0 -70
  653. data/spec/unit/cookbook/metadata_spec.rb +0 -610
  654. data/spec/unit/cookbook/synchronizer_spec.rb +0 -560
  655. data/spec/unit/cookbook/syntax_check_spec.rb +0 -229
  656. data/spec/unit/cookbook_loader_spec.rb +0 -265
  657. data/spec/unit/cookbook_manifest_spec.rb +0 -228
  658. data/spec/unit/cookbook_spec.rb +0 -62
  659. data/spec/unit/cookbook_uploader_spec.rb +0 -205
  660. data/spec/unit/cookbook_version_file_specificity_spec.rb +0 -623
  661. data/spec/unit/cookbook_version_spec.rb +0 -341
  662. data/spec/unit/daemon_spec.rb +0 -179
  663. data/spec/unit/data_bag_item_spec.rb +0 -387
  664. data/spec/unit/data_bag_spec.rb +0 -263
  665. data/spec/unit/data_collector/config_validation_spec.rb +0 -208
  666. data/spec/unit/data_collector_spec.rb +0 -1076
  667. data/spec/unit/decorator/lazy_array_spec.rb +0 -58
  668. data/spec/unit/decorator/lazy_spec.rb +0 -39
  669. data/spec/unit/decorator_spec.rb +0 -142
  670. data/spec/unit/delayed_evaluator_spec.rb +0 -35
  671. data/spec/unit/deprecated_spec.rb +0 -65
  672. data/spec/unit/deprecation_spec.rb +0 -129
  673. data/spec/unit/digester_spec.rb +0 -49
  674. data/spec/unit/dsl/data_query_spec.rb +0 -108
  675. data/spec/unit/dsl/declare_resource_spec.rb +0 -374
  676. data/spec/unit/dsl/platform_introspection_spec.rb +0 -160
  677. data/spec/unit/dsl/reboot_pending_spec.rb +0 -87
  678. data/spec/unit/dsl/recipe_spec.rb +0 -76
  679. data/spec/unit/dsl/registry_helper_spec.rb +0 -52
  680. data/spec/unit/dsl/render_helpers_spec.rb +0 -102
  681. data/spec/unit/dsl/resources_spec.rb +0 -85
  682. data/spec/unit/dsl/secret_spec.rb +0 -175
  683. data/spec/unit/encrypted_data_bag_item/check_encrypted_spec.rb +0 -97
  684. data/spec/unit/encrypted_data_bag_item_spec.rb +0 -439
  685. data/spec/unit/environment_spec.rb +0 -476
  686. data/spec/unit/event_dispatch/dispatcher_spec.rb +0 -172
  687. data/spec/unit/event_dispatch/dsl_spec.rb +0 -83
  688. data/spec/unit/exceptions_spec.rb +0 -132
  689. data/spec/unit/file_access_control_spec.rb +0 -308
  690. data/spec/unit/file_cache_spec.rb +0 -178
  691. data/spec/unit/file_content_management/deploy/cp_spec.rb +0 -44
  692. data/spec/unit/file_content_management/deploy/mv_unix_spec.rb +0 -113
  693. data/spec/unit/file_content_management/deploy/mv_windows_spec.rb +0 -232
  694. data/spec/unit/file_content_management/tempfile_spec.rb +0 -115
  695. data/spec/unit/formatters/base_spec.rb +0 -100
  696. data/spec/unit/formatters/doc_spec.rb +0 -110
  697. data/spec/unit/formatters/error_description_spec.rb +0 -141
  698. data/spec/unit/formatters/error_inspectors/api_error_formatting_spec.rb +0 -76
  699. data/spec/unit/formatters/error_inspectors/compile_error_inspector_spec.rb +0 -265
  700. data/spec/unit/formatters/error_inspectors/cookbook_resolve_error_inspector_spec.rb +0 -126
  701. data/spec/unit/formatters/error_inspectors/cookbook_sync_error_inspector_spec.rb +0 -43
  702. data/spec/unit/formatters/error_inspectors/node_load_error_inspector_spec.rb +0 -26
  703. data/spec/unit/formatters/error_inspectors/registration_error_inspector_spec.rb +0 -26
  704. data/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +0 -191
  705. data/spec/unit/formatters/error_inspectors/run_list_expansion_error_inspector_spec.rb +0 -91
  706. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +0 -155
  707. data/spec/unit/guard_interpreter_spec.rb +0 -41
  708. data/spec/unit/handler/json_file_spec.rb +0 -63
  709. data/spec/unit/handler_spec.rb +0 -308
  710. data/spec/unit/http/api_versions_spec.rb +0 -100
  711. data/spec/unit/http/authenticator_spec.rb +0 -247
  712. data/spec/unit/http/basic_client_spec.rb +0 -102
  713. data/spec/unit/http/http_request_spec.rb +0 -97
  714. data/spec/unit/http/json_input_spec.rb +0 -128
  715. data/spec/unit/http/simple_spec.rb +0 -32
  716. data/spec/unit/http/socketless_chef_zero_client_spec.rb +0 -174
  717. data/spec/unit/http/ssl_policies_spec.rb +0 -228
  718. data/spec/unit/http/validate_content_length_spec.rb +0 -207
  719. data/spec/unit/http_spec.rb +0 -235
  720. data/spec/unit/json_compat_spec.rb +0 -73
  721. data/spec/unit/key_spec.rb +0 -631
  722. data/spec/unit/log/syslog_spec.rb +0 -47
  723. data/spec/unit/log/winevt_spec.rb +0 -62
  724. data/spec/unit/lwrp_spec.rb +0 -693
  725. data/spec/unit/mixin/api_version_request_handling_spec.rb +0 -126
  726. data/spec/unit/mixin/checksum_spec.rb +0 -82
  727. data/spec/unit/mixin/convert_to_class_name_spec.rb +0 -54
  728. data/spec/unit/mixin/deep_merge_spec.rb +0 -357
  729. data/spec/unit/mixin/default_paths_spec.rb +0 -92
  730. data/spec/unit/mixin/deprecation_spec.rb +0 -57
  731. data/spec/unit/mixin/enforce_ownership_and_permissions_spec.rb +0 -96
  732. data/spec/unit/mixin/homebrew_spec.rb +0 -118
  733. data/spec/unit/mixin/lazy_module_include.rb +0 -71
  734. data/spec/unit/mixin/openssl_helper_spec.rb +0 -897
  735. data/spec/unit/mixin/params_validate_spec.rb +0 -422
  736. data/spec/unit/mixin/powershell_exec_spec.rb +0 -90
  737. data/spec/unit/mixin/powershell_out_spec.rb +0 -106
  738. data/spec/unit/mixin/powershell_type_coercions_spec.rb +0 -84
  739. data/spec/unit/mixin/properties_spec.rb +0 -107
  740. data/spec/unit/mixin/proxified_socket_spec.rb +0 -97
  741. data/spec/unit/mixin/securable_spec.rb +0 -313
  742. data/spec/unit/mixin/shell_out_spec.rb +0 -308
  743. data/spec/unit/mixin/subclass_directive_spec.rb +0 -45
  744. data/spec/unit/mixin/template_spec.rb +0 -317
  745. data/spec/unit/mixin/unformatter_spec.rb +0 -60
  746. data/spec/unit/mixin/uris_spec.rb +0 -57
  747. data/spec/unit/mixin/user_context_spec.rb +0 -99
  748. data/spec/unit/mixin/versioned_api_spec.rb +0 -128
  749. data/spec/unit/mixin/which.rb +0 -170
  750. data/spec/unit/mixin/why_run_spec.rb +0 -53
  751. data/spec/unit/mixin/windows_architecture_helper_spec.rb +0 -85
  752. data/spec/unit/mixin/xml_escape_spec.rb +0 -54
  753. data/spec/unit/monologger_spec.rb +0 -45
  754. data/spec/unit/node/attribute_spec.rb +0 -1322
  755. data/spec/unit/node/immutable_collections_spec.rb +0 -258
  756. data/spec/unit/node/vivid_mash_spec.rb +0 -500
  757. data/spec/unit/node_map_spec.rb +0 -276
  758. data/spec/unit/node_spec.rb +0 -2038
  759. data/spec/unit/org_group_spec.rb +0 -45
  760. data/spec/unit/org_spec.rb +0 -196
  761. data/spec/unit/platform/query_helpers_spec.rb +0 -48
  762. data/spec/unit/policy_builder/dynamic_spec.rb +0 -256
  763. data/spec/unit/policy_builder/expand_node_object_spec.rb +0 -311
  764. data/spec/unit/policy_builder/policyfile_spec.rb +0 -960
  765. data/spec/unit/policy_builder_spec.rb +0 -26
  766. data/spec/unit/property/state_spec.rb +0 -514
  767. data/spec/unit/property/validation_spec.rb +0 -813
  768. data/spec/unit/property_spec.rb +0 -1329
  769. data/spec/unit/provider/apt_preference_spec.rb +0 -91
  770. data/spec/unit/provider/apt_repository_spec.rb +0 -370
  771. data/spec/unit/provider/apt_update_spec.rb +0 -119
  772. data/spec/unit/provider/batch_spec.rb +0 -130
  773. data/spec/unit/provider/cookbook_file/content_spec.rb +0 -39
  774. data/spec/unit/provider/cookbook_file_spec.rb +0 -59
  775. data/spec/unit/provider/cron/unix_spec.rb +0 -144
  776. data/spec/unit/provider/cron_spec.rb +0 -1252
  777. data/spec/unit/provider/directory_spec.rb +0 -289
  778. data/spec/unit/provider/dsc_resource_spec.rb +0 -313
  779. data/spec/unit/provider/dsc_script_spec.rb +0 -173
  780. data/spec/unit/provider/execute_spec.rb +0 -244
  781. data/spec/unit/provider/file/content_spec.rb +0 -114
  782. data/spec/unit/provider/file_spec.rb +0 -58
  783. data/spec/unit/provider/git_spec.rb +0 -822
  784. data/spec/unit/provider/group/dscl_spec.rb +0 -339
  785. data/spec/unit/provider/group/gpasswd_spec.rb +0 -119
  786. data/spec/unit/provider/group/groupadd_spec.rb +0 -195
  787. data/spec/unit/provider/group/groupmod_spec.rb +0 -136
  788. data/spec/unit/provider/group/pw_spec.rb +0 -141
  789. data/spec/unit/provider/group/solaris_spec.rb +0 -106
  790. data/spec/unit/provider/group/usermod_spec.rb +0 -112
  791. data/spec/unit/provider/group/windows_spec.rb +0 -130
  792. data/spec/unit/provider/group_spec.rb +0 -285
  793. data/spec/unit/provider/http_request_spec.rb +0 -147
  794. data/spec/unit/provider/ifconfig/aix_spec.rb +0 -180
  795. data/spec/unit/provider/ifconfig/debian_spec.rb +0 -332
  796. data/spec/unit/provider/ifconfig/redhat_spec.rb +0 -83
  797. data/spec/unit/provider/ifconfig_spec.rb +0 -247
  798. data/spec/unit/provider/launchd_spec.rb +0 -234
  799. data/spec/unit/provider/link_spec.rb +0 -425
  800. data/spec/unit/provider/log_spec.rb +0 -94
  801. data/spec/unit/provider/mdadm_spec.rb +0 -138
  802. data/spec/unit/provider/mount/aix_spec.rb +0 -277
  803. data/spec/unit/provider/mount/linux_spec.rb +0 -131
  804. data/spec/unit/provider/mount/mount_spec.rb +0 -590
  805. data/spec/unit/provider/mount/solaris_spec.rb +0 -822
  806. data/spec/unit/provider/mount/windows_spec.rb +0 -150
  807. data/spec/unit/provider/mount_spec.rb +0 -222
  808. data/spec/unit/provider/package/apt_spec.rb +0 -703
  809. data/spec/unit/provider/package/bff_spec.rb +0 -188
  810. data/spec/unit/provider/package/cab_spec.rb +0 -272
  811. data/spec/unit/provider/package/chocolatey_spec.rb +0 -574
  812. data/spec/unit/provider/package/deb_spec.rb +0 -135
  813. data/spec/unit/provider/package/dnf/python_helper_spec.rb +0 -36
  814. data/spec/unit/provider/package/dpkg_spec.rb +0 -314
  815. data/spec/unit/provider/package/freebsd/pkgng_spec.rb +0 -147
  816. data/spec/unit/provider/package/freebsd/port_spec.rb +0 -151
  817. data/spec/unit/provider/package/homebrew_spec.rb +0 -402
  818. data/spec/unit/provider/package/ips_spec.rb +0 -233
  819. data/spec/unit/provider/package/macports_spec.rb +0 -203
  820. data/spec/unit/provider/package/msu_spec.rb +0 -283
  821. data/spec/unit/provider/package/openbsd_spec.rb +0 -136
  822. data/spec/unit/provider/package/pacman_spec.rb +0 -109
  823. data/spec/unit/provider/package/paludis_spec.rb +0 -134
  824. data/spec/unit/provider/package/portage_spec.rb +0 -179
  825. data/spec/unit/provider/package/powershell_spec.rb +0 -565
  826. data/spec/unit/provider/package/rpm_spec.rb +0 -440
  827. data/spec/unit/provider/package/rubygems_spec.rb +0 -1187
  828. data/spec/unit/provider/package/smartos_spec.rb +0 -110
  829. data/spec/unit/provider/package/snap_spec.rb +0 -208
  830. data/spec/unit/provider/package/solaris_spec.rb +0 -168
  831. data/spec/unit/provider/package/windows/exe_spec.rb +0 -201
  832. data/spec/unit/provider/package/windows/msi_spec.rb +0 -168
  833. data/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb +0 -78
  834. data/spec/unit/provider/package/windows_spec.rb +0 -441
  835. data/spec/unit/provider/package/yum/python_helper_spec.rb +0 -30
  836. data/spec/unit/provider/package/yum/yum_cache_spec.rb +0 -109
  837. data/spec/unit/provider/package/zypper_spec.rb +0 -494
  838. data/spec/unit/provider/package_spec.rb +0 -791
  839. data/spec/unit/provider/powershell_script_spec.rb +0 -157
  840. data/spec/unit/provider/registry_key_spec.rb +0 -487
  841. data/spec/unit/provider/remote_directory_spec.rb +0 -236
  842. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +0 -245
  843. data/spec/unit/provider/remote_file/content_spec.rb +0 -253
  844. data/spec/unit/provider/remote_file/fetcher_spec.rb +0 -95
  845. data/spec/unit/provider/remote_file/ftp_spec.rb +0 -217
  846. data/spec/unit/provider/remote_file/http_spec.rb +0 -334
  847. data/spec/unit/provider/remote_file/local_file_spec.rb +0 -105
  848. data/spec/unit/provider/remote_file/network_file_spec.rb +0 -50
  849. data/spec/unit/provider/remote_file/sftp_spec.rb +0 -150
  850. data/spec/unit/provider/remote_file_spec.rb +0 -61
  851. data/spec/unit/provider/route_spec.rb +0 -268
  852. data/spec/unit/provider/ruby_block_spec.rb +0 -45
  853. data/spec/unit/provider/script_spec.rb +0 -67
  854. data/spec/unit/provider/service/aix_service_spec.rb +0 -195
  855. data/spec/unit/provider/service/aixinit_service_spec.rb +0 -272
  856. data/spec/unit/provider/service/arch_service_spec.rb +0 -326
  857. data/spec/unit/provider/service/debian_service_spec.rb +0 -273
  858. data/spec/unit/provider/service/freebsd_service_spec.rb +0 -621
  859. data/spec/unit/provider/service/gentoo_service_spec.rb +0 -145
  860. data/spec/unit/provider/service/init_service_spec.rb +0 -235
  861. data/spec/unit/provider/service/insserv_service_spec.rb +0 -75
  862. data/spec/unit/provider/service/invokercd_service_spec.rb +0 -211
  863. data/spec/unit/provider/service/macosx_spec.rb +0 -337
  864. data/spec/unit/provider/service/openbsd_service_spec.rb +0 -553
  865. data/spec/unit/provider/service/redhat_spec.rb +0 -253
  866. data/spec/unit/provider/service/simple_service_spec.rb +0 -171
  867. data/spec/unit/provider/service/solaris_smf_service_spec.rb +0 -292
  868. data/spec/unit/provider/service/systemd_service_spec.rb +0 -504
  869. data/spec/unit/provider/service/upstart_service_spec.rb +0 -322
  870. data/spec/unit/provider/service/windows_spec.rb +0 -986
  871. data/spec/unit/provider/service_spec.rb +0 -168
  872. data/spec/unit/provider/subversion_spec.rb +0 -364
  873. data/spec/unit/provider/systemd_unit_spec.rb +0 -1039
  874. data/spec/unit/provider/template/content_spec.rb +0 -169
  875. data/spec/unit/provider/template_spec.rb +0 -86
  876. data/spec/unit/provider/user/aix_spec.rb +0 -96
  877. data/spec/unit/provider/user/linux_spec.rb +0 -178
  878. data/spec/unit/provider/user/mac_spec.rb +0 -38
  879. data/spec/unit/provider/user/pw_spec.rb +0 -235
  880. data/spec/unit/provider/user/solaris_spec.rb +0 -177
  881. data/spec/unit/provider/user/windows_spec.rb +0 -198
  882. data/spec/unit/provider/user_spec.rb +0 -520
  883. data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +0 -46
  884. data/spec/unit/provider/windows_env_spec.rb +0 -385
  885. data/spec/unit/provider/windows_path_spec.rb +0 -60
  886. data/spec/unit/provider/windows_task_spec.rb +0 -436
  887. data/spec/unit/provider/yum_repository_spec.rb +0 -35
  888. data/spec/unit/provider/zypper_repository_spec.rb +0 -169
  889. data/spec/unit/provider_spec.rb +0 -215
  890. data/spec/unit/pure_application_spec.rb +0 -32
  891. data/spec/unit/recipe_spec.rb +0 -703
  892. data/spec/unit/resource/alternatives_spec.rb +0 -120
  893. data/spec/unit/resource/apt_package_spec.rb +0 -71
  894. data/spec/unit/resource/apt_preference_spec.rb +0 -39
  895. data/spec/unit/resource/apt_repository_spec.rb +0 -79
  896. data/spec/unit/resource/apt_update_spec.rb +0 -44
  897. data/spec/unit/resource/archive_file_spec.rb +0 -466
  898. data/spec/unit/resource/bash_spec.rb +0 -45
  899. data/spec/unit/resource/batch_spec.rb +0 -46
  900. data/spec/unit/resource/bff_package_spec.rb +0 -51
  901. data/spec/unit/resource/breakpoint_spec.rb +0 -64
  902. data/spec/unit/resource/build_essential_spec.rb +0 -77
  903. data/spec/unit/resource/cab_package_spec.rb +0 -64
  904. data/spec/unit/resource/chef_client_config_spec.rb +0 -145
  905. data/spec/unit/resource/chef_client_cron_spec.rb +0 -161
  906. data/spec/unit/resource/chef_client_launchd_spec.rb +0 -132
  907. data/spec/unit/resource/chef_client_scheduled_task_spec.rb +0 -186
  908. data/spec/unit/resource/chef_client_systemd_timer_spec.rb +0 -108
  909. data/spec/unit/resource/chef_client_trusted_certificate_spec.rb +0 -68
  910. data/spec/unit/resource/chef_gem_spec.rb +0 -122
  911. data/spec/unit/resource/chef_handler_spec.rb +0 -40
  912. data/spec/unit/resource/chef_sleep_spec.rb +0 -30
  913. data/spec/unit/resource/chef_vault_secret_spec.rb +0 -40
  914. data/spec/unit/resource/chocolatey_config_spec.rb +0 -93
  915. data/spec/unit/resource/chocolatey_feature_spec.rb +0 -89
  916. data/spec/unit/resource/chocolatey_installer_spec.rb +0 -151
  917. data/spec/unit/resource/chocolatey_package_spec.rb +0 -106
  918. data/spec/unit/resource/chocolatey_source_spec.rb +0 -151
  919. data/spec/unit/resource/conditional_action_not_nothing_spec.rb +0 -45
  920. data/spec/unit/resource/conditional_spec.rb +0 -254
  921. data/spec/unit/resource/cookbook_file_spec.rb +0 -93
  922. data/spec/unit/resource/cron_access_spec.rb +0 -36
  923. data/spec/unit/resource/cron_d_spec.rb +0 -84
  924. data/spec/unit/resource/cron_spec.rb +0 -167
  925. data/spec/unit/resource/csh_spec.rb +0 -45
  926. data/spec/unit/resource/directory_spec.rb +0 -69
  927. data/spec/unit/resource/dmg_package_spec.rb +0 -39
  928. data/spec/unit/resource/dnf_package_spec.rb +0 -114
  929. data/spec/unit/resource/dpkg_package_spec.rb +0 -72
  930. data/spec/unit/resource/dsc_resource_spec.rb +0 -102
  931. data/spec/unit/resource/dsc_script_spec.rb +0 -134
  932. data/spec/unit/resource/execute_spec.rb +0 -282
  933. data/spec/unit/resource/file/verification/json_spec.rb +0 -72
  934. data/spec/unit/resource/file/verification/systemd_unit_spec.rb +0 -103
  935. data/spec/unit/resource/file/verification/yaml_spec.rb +0 -67
  936. data/spec/unit/resource/file/verification_spec.rb +0 -147
  937. data/spec/unit/resource/file_spec.rb +0 -127
  938. data/spec/unit/resource/freebsd_package_spec.rb +0 -77
  939. data/spec/unit/resource/gem_package_spec.rb +0 -67
  940. data/spec/unit/resource/group_spec.rb +0 -165
  941. data/spec/unit/resource/helpers/cron_validations_spec.rb +0 -81
  942. data/spec/unit/resource/homebrew_cask_spec.rb +0 -58
  943. data/spec/unit/resource/homebrew_package_spec.rb +0 -68
  944. data/spec/unit/resource/homebrew_tap_spec.rb +0 -44
  945. data/spec/unit/resource/homebrew_update_spec.rb +0 -30
  946. data/spec/unit/resource/hostname_spec.rb +0 -47
  947. data/spec/unit/resource/http_request_spec.rb +0 -65
  948. data/spec/unit/resource/ifconfig_spec.rb +0 -101
  949. data/spec/unit/resource/inspec_input_spec.rb +0 -300
  950. data/spec/unit/resource/inspec_waiver_file_entry_spec.rb +0 -80
  951. data/spec/unit/resource/inspec_waiver_spec.rb +0 -312
  952. data/spec/unit/resource/ips_package_spec.rb +0 -54
  953. data/spec/unit/resource/kernel_module_spec.rb +0 -45
  954. data/spec/unit/resource/ksh_spec.rb +0 -45
  955. data/spec/unit/resource/launchd_spec.rb +0 -48
  956. data/spec/unit/resource/link_spec.rb +0 -120
  957. data/spec/unit/resource/locale_spec.rb +0 -189
  958. data/spec/unit/resource/log_spec.rb +0 -64
  959. data/spec/unit/resource/macos_pkg_spec.rb +0 -38
  960. data/spec/unit/resource/macos_user_defaults_spec.rb +0 -76
  961. data/spec/unit/resource/macosx_service.rb +0 -37
  962. data/spec/unit/resource/macports_package_spec.rb +0 -51
  963. data/spec/unit/resource/mdadm_spec.rb +0 -104
  964. data/spec/unit/resource/mount_spec.rb +0 -201
  965. data/spec/unit/resource/msu_package_spec.rb +0 -67
  966. data/spec/unit/resource/notify_group_spec.rb +0 -34
  967. data/spec/unit/resource/ohai_hint_spec.rb +0 -44
  968. data/spec/unit/resource/ohai_spec.rb +0 -185
  969. data/spec/unit/resource/openbsd_package_spec.rb +0 -58
  970. data/spec/unit/resource/openssl_dhparam_spec.rb +0 -61
  971. data/spec/unit/resource/openssl_ec_private_key_spec.rb +0 -64
  972. data/spec/unit/resource/openssl_ec_public_key_spec.rb +0 -43
  973. data/spec/unit/resource/openssl_rsa_private_key_spec.rb +0 -64
  974. data/spec/unit/resource/openssl_rsa_public_key_spec.rb +0 -43
  975. data/spec/unit/resource/openssl_x509_certificate_spec.rb +0 -72
  976. data/spec/unit/resource/openssl_x509_crl_spec.rb +0 -61
  977. data/spec/unit/resource/openssl_x509_request.rb +0 -68
  978. data/spec/unit/resource/osx_profile_spec.rb +0 -360
  979. data/spec/unit/resource/package_spec.rb +0 -98
  980. data/spec/unit/resource/pacman_package_spec.rb +0 -46
  981. data/spec/unit/resource/paludis_package_spec.rb +0 -36
  982. data/spec/unit/resource/perl_spec.rb +0 -44
  983. data/spec/unit/resource/plist_spec.rb +0 -130
  984. data/spec/unit/resource/portage_package_spec.rb +0 -46
  985. data/spec/unit/resource/powershell_package_source_spec.rb +0 -220
  986. data/spec/unit/resource/powershell_package_spec.rb +0 -98
  987. data/spec/unit/resource/powershell_script_spec.rb +0 -65
  988. data/spec/unit/resource/python_spec.rb +0 -40
  989. data/spec/unit/resource/reboot_spec.rb +0 -47
  990. data/spec/unit/resource/registry_key_spec.rb +0 -215
  991. data/spec/unit/resource/remote_directory_spec.rb +0 -118
  992. data/spec/unit/resource/remote_file_spec.rb +0 -220
  993. data/spec/unit/resource/resource_notification_spec.rb +0 -169
  994. data/spec/unit/resource/rest_resource_spec.rb +0 -381
  995. data/spec/unit/resource/rhsm_errata_level_spec.rb +0 -50
  996. data/spec/unit/resource/rhsm_errata_spec.rb +0 -39
  997. data/spec/unit/resource/rhsm_register_spec.rb +0 -308
  998. data/spec/unit/resource/rhsm_repo_spec.rb +0 -70
  999. data/spec/unit/resource/rhsm_subscription_spec.rb +0 -145
  1000. data/spec/unit/resource/route_spec.rb +0 -100
  1001. data/spec/unit/resource/rpm_package_spec.rb +0 -62
  1002. data/spec/unit/resource/ruby_block_spec.rb +0 -58
  1003. data/spec/unit/resource/ruby_spec.rb +0 -39
  1004. data/spec/unit/resource/scm/git_spec.rb +0 -110
  1005. data/spec/unit/resource/scm/scm.rb +0 -122
  1006. data/spec/unit/resource/scm/subversion_spec.rb +0 -90
  1007. data/spec/unit/resource/script_spec.rb +0 -57
  1008. data/spec/unit/resource/selinux_boolean_spec.rb +0 -92
  1009. data/spec/unit/resource/selinux_fcontext_spec.rb +0 -65
  1010. data/spec/unit/resource/selinux_install_spec.rb +0 -60
  1011. data/spec/unit/resource/selinux_login_spec.rb +0 -73
  1012. data/spec/unit/resource/selinux_module_spec.rb +0 -55
  1013. data/spec/unit/resource/selinux_permissive_spec.rb +0 -39
  1014. data/spec/unit/resource/selinux_port_spec.rb +0 -42
  1015. data/spec/unit/resource/selinux_state_spec.rb +0 -46
  1016. data/spec/unit/resource/selinux_user_spec.rb +0 -92
  1017. data/spec/unit/resource/service_spec.rb +0 -203
  1018. data/spec/unit/resource/smartos_package_spec.rb +0 -52
  1019. data/spec/unit/resource/snap_package_spec.rb +0 -60
  1020. data/spec/unit/resource/solaris_package_spec.rb +0 -52
  1021. data/spec/unit/resource/ssh_known_hosts_entry_spec.rb +0 -50
  1022. data/spec/unit/resource/sudo_spec.rb +0 -99
  1023. data/spec/unit/resource/swap_file_spec.rb +0 -39
  1024. data/spec/unit/resource/sysctl_spec.rb +0 -76
  1025. data/spec/unit/resource/systemd_unit_spec.rb +0 -130
  1026. data/spec/unit/resource/template_spec.rb +0 -222
  1027. data/spec/unit/resource/timezone_spec.rb +0 -102
  1028. data/spec/unit/resource/user/linux_user_spec.rb +0 -42
  1029. data/spec/unit/resource/user/windows_user_spec.rb +0 -36
  1030. data/spec/unit/resource/user_spec.rb +0 -121
  1031. data/spec/unit/resource/user_ulimit_spec.rb +0 -66
  1032. data/spec/unit/resource/windows_ad_join_spec.rb +0 -55
  1033. data/spec/unit/resource/windows_audit_policy_spec.rb +0 -64
  1034. data/spec/unit/resource/windows_auto_run_spec.rb +0 -50
  1035. data/spec/unit/resource/windows_certificate_spec.rb +0 -95
  1036. data/spec/unit/resource/windows_defender_exclusion_spec.rb +0 -62
  1037. data/spec/unit/resource/windows_defender_spec.rb +0 -71
  1038. data/spec/unit/resource/windows_dfs_folder_spec.rb +0 -39
  1039. data/spec/unit/resource/windows_dfs_namespace_spec.rb +0 -39
  1040. data/spec/unit/resource/windows_dfs_server_spec.rb +0 -34
  1041. data/spec/unit/resource/windows_dns_record_spec.rb +0 -55
  1042. data/spec/unit/resource/windows_dns_zone_spec.rb +0 -51
  1043. data/spec/unit/resource/windows_env_spec.rb +0 -75
  1044. data/spec/unit/resource/windows_feature_dism_spec.rb +0 -57
  1045. data/spec/unit/resource/windows_feature_powershell_spec.rb +0 -83
  1046. data/spec/unit/resource/windows_feature_spec.rb +0 -64
  1047. data/spec/unit/resource/windows_firewall_profile_spec.rb +0 -77
  1048. data/spec/unit/resource/windows_firewall_rule_spec.rb +0 -510
  1049. data/spec/unit/resource/windows_font_spec.rb +0 -43
  1050. data/spec/unit/resource/windows_package_spec.rb +0 -125
  1051. data/spec/unit/resource/windows_pagefile_spec.rb +0 -44
  1052. data/spec/unit/resource/windows_path_spec.rb +0 -40
  1053. data/spec/unit/resource/windows_printer_port_spec.rb +0 -62
  1054. data/spec/unit/resource/windows_printer_spec.rb +0 -52
  1055. data/spec/unit/resource/windows_service_spec.rb +0 -122
  1056. data/spec/unit/resource/windows_share_spec.rb +0 -48
  1057. data/spec/unit/resource/windows_shortcut_spec.rb +0 -38
  1058. data/spec/unit/resource/windows_task_spec.rb +0 -403
  1059. data/spec/unit/resource/windows_uac_spec.rb +0 -50
  1060. data/spec/unit/resource/windows_update_settings_spec.rb +0 -64
  1061. data/spec/unit/resource/windows_user_privilege_spec.rb +0 -55
  1062. data/spec/unit/resource/windows_workgroup_spec.rb +0 -74
  1063. data/spec/unit/resource/yum_package_spec.rb +0 -159
  1064. data/spec/unit/resource/yum_repository_spec.rb +0 -156
  1065. data/spec/unit/resource/zypper_package_spec.rb +0 -51
  1066. data/spec/unit/resource/zypper_repository_spec.rb +0 -115
  1067. data/spec/unit/resource_builder_spec.rb +0 -1
  1068. data/spec/unit/resource_collection/resource_list_spec.rb +0 -137
  1069. data/spec/unit/resource_collection/resource_set_spec.rb +0 -244
  1070. data/spec/unit/resource_collection/stepable_iterator_spec.rb +0 -144
  1071. data/spec/unit/resource_collection_spec.rb +0 -408
  1072. data/spec/unit/resource_definition_spec.rb +0 -117
  1073. data/spec/unit/resource_inspector_spec.rb +0 -101
  1074. data/spec/unit/resource_reporter_spec.rb +0 -802
  1075. data/spec/unit/resource_resolver_spec.rb +0 -52
  1076. data/spec/unit/resource_spec.rb +0 -1484
  1077. data/spec/unit/role_spec.rb +0 -363
  1078. data/spec/unit/run_context/child_run_context_spec.rb +0 -126
  1079. data/spec/unit/run_context/cookbook_compiler_spec.rb +0 -236
  1080. data/spec/unit/run_context_spec.rb +0 -257
  1081. data/spec/unit/run_list/run_list_expansion_spec.rb +0 -147
  1082. data/spec/unit/run_list/run_list_item_spec.rb +0 -117
  1083. data/spec/unit/run_list/versioned_recipe_list_spec.rb +0 -197
  1084. data/spec/unit/run_list_spec.rb +0 -312
  1085. data/spec/unit/run_lock_spec.rb +0 -144
  1086. data/spec/unit/run_status_spec.rb +0 -144
  1087. data/spec/unit/runner_spec.rb +0 -397
  1088. data/spec/unit/scan_access_control_spec.rb +0 -183
  1089. data/spec/unit/search/query_spec.rb +0 -291
  1090. data/spec/unit/secret_fetcher/akeyless_vault_spec.rb +0 -37
  1091. data/spec/unit/secret_fetcher/aws_secrets_manager_spec.rb +0 -70
  1092. data/spec/unit/secret_fetcher/azure_key_vault_spec.rb +0 -149
  1093. data/spec/unit/secret_fetcher/hashi_vault_spec.rb +0 -126
  1094. data/spec/unit/secret_fetcher_spec.rb +0 -82
  1095. data/spec/unit/server_api_spec.rb +0 -151
  1096. data/spec/unit/server_api_versions_spec.rb +0 -66
  1097. data/spec/unit/shell/model_wrapper_spec.rb +0 -96
  1098. data/spec/unit/shell/shell_ext_spec.rb +0 -196
  1099. data/spec/unit/shell/shell_session_spec.rb +0 -218
  1100. data/spec/unit/shell_spec.rb +0 -178
  1101. data/spec/unit/train_transport_spec.rb +0 -85
  1102. data/spec/unit/user_spec.rb +0 -275
  1103. data/spec/unit/user_v1_spec.rb +0 -585
  1104. data/spec/unit/util/backup_spec.rb +0 -141
  1105. data/spec/unit/util/diff_spec.rb +0 -562
  1106. data/spec/unit/util/dsc/configuration_generator_spec.rb +0 -272
  1107. data/spec/unit/util/dsc/lcm_output_parser_spec.rb +0 -248
  1108. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +0 -192
  1109. data/spec/unit/util/dsc/resource_store.rb +0 -78
  1110. data/spec/unit/util/editor_spec.rb +0 -152
  1111. data/spec/unit/util/file_edit_spec.rb +0 -224
  1112. data/spec/unit/util/powershell/ps_credential_spec.rb +0 -51
  1113. data/spec/unit/util/selinux_spec.rb +0 -160
  1114. data/spec/unit/util/threaded_job_queue_spec.rb +0 -60
  1115. data/spec/unit/util/windows/logon_session_spec.rb +0 -285
  1116. data/spec/unit/version/platform_spec.rb +0 -60
  1117. data/spec/unit/version_class_spec.rb +0 -171
  1118. data/spec/unit/version_constraint/platform_spec.rb +0 -45
  1119. data/spec/unit/version_constraint_spec.rb +0 -179
  1120. data/spec/unit/version_string_spec.rb +0 -79
  1121. data/spec/unit/win32/error_spec.rb +0 -77
  1122. data/spec/unit/win32/link_spec.rb +0 -73
  1123. data/spec/unit/win32/registry_spec.rb +0 -394
  1124. data/spec/unit/win32/security_spec.rb +0 -136
  1125. data/tasks/rspec.rb +0 -87
@@ -1,1252 +0,0 @@
1
- #
2
- # Author:: Bryan McLellan (btm@loftninjas.org)
3
- # Copyright:: Copyright 2009-2020, Bryan McLellan
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- require "spec_helper"
19
-
20
- describe Chef::Provider::Cron do
21
- let(:logger) { double("Mixlib::Log::Child").as_null_object }
22
-
23
- before do
24
- @node = Chef::Node.new
25
- @events = Chef::EventDispatch::Dispatcher.new
26
- @run_context = Chef::RunContext.new(@node, {}, @events)
27
- allow(@run_context).to receive(:logger).and_return(logger)
28
-
29
- @new_resource = Chef::Resource::Cron.new("cronhole some stuff", @run_context)
30
- @new_resource.user "root"
31
- @new_resource.minute "30"
32
- @new_resource.command "/bin/true"
33
- @provider = Chef::Provider::Cron.new(@new_resource, @run_context)
34
- end
35
-
36
- describe "when with special time string" do
37
- before do
38
- @new_resource.time :reboot
39
- @provider = Chef::Provider::Cron.new(@new_resource, @run_context)
40
- end
41
-
42
- context "with a matching entry in the user's crontab" do
43
- before :each do
44
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
45
- 0 2 * * * /some/other/command
46
-
47
- # Chef Name: cronhole some stuff
48
- @reboot /bin/true param1 param2
49
- # Chef Name: something else
50
- 2 * 1 * * /bin/false
51
-
52
- # Another comment
53
- CRONTAB
54
- end
55
-
56
- it "should set cron_exists" do
57
- @provider.load_current_resource
58
- expect(@provider.cron_exists).to eq(true)
59
- expect(@provider.cron_empty).to eq(false)
60
- end
61
-
62
- it "should pull the details out of the cron line" do
63
- cron = @provider.load_current_resource
64
- expect(cron.time).to eq(:reboot)
65
- expect(cron.command).to eq("/bin/true param1 param2")
66
- end
67
-
68
- it "should pull env vars out" do
69
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
70
- 0 2 * * * /some/other/command
71
-
72
- # Chef Name: cronhole some stuff
73
- MAILTO=foo@example.com
74
- SHELL=/bin/foosh
75
- PATH=/bin:/foo
76
- HOME=/home/foo
77
- @reboot /bin/true param1 param2
78
- # Chef Name: something else
79
- 2 * 1 * * /bin/false
80
-
81
- # Another comment
82
- CRONTAB
83
- cron = @provider.load_current_resource
84
- expect(cron.mailto).to eq("foo@example.com")
85
- expect(cron.shell).to eq("/bin/foosh")
86
- expect(cron.path).to eq("/bin:/foo")
87
- expect(cron.home).to eq("/home/foo")
88
- expect(cron.time).to eq(:reboot)
89
- expect(cron.command).to eq("/bin/true param1 param2")
90
- end
91
-
92
- it "should parse and load generic and standard environment variables from cron entry" do
93
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
94
- # Chef Name: cronhole some stuff
95
- MAILTO=warn@example.com
96
- TEST=lol
97
- FLAG=1
98
- @reboot /bin/true
99
- CRONTAB
100
- cron = @provider.load_current_resource
101
-
102
- expect(cron.mailto).to eq("warn@example.com")
103
- expect(cron.environment).to eq({ "TEST" => "lol", "FLAG" => "1" })
104
- end
105
-
106
- it "should not break with variables that match the cron resource internals" do
107
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
108
- # Chef Name: cronhole some stuff
109
- MINUTE=40
110
- REBOOT=midnight
111
- TEST=lol
112
- ENVIRONMENT=production
113
- @reboot /bin/true
114
- CRONTAB
115
- cron = @provider.load_current_resource
116
-
117
- expect(cron.time).to eq(:reboot)
118
- expect(cron.environment).to eq({ "MINUTE" => "40", "REBOOT" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production" })
119
- end
120
-
121
- it "should report the match" do
122
- expect(logger).to receive(:trace).with("Found cron '#{@new_resource.name}'")
123
- @provider.load_current_resource
124
- end
125
-
126
- describe "action_create" do
127
- before :each do
128
- allow(@provider).to receive(:write_crontab)
129
- allow(@provider).to receive(:read_crontab).and_return(nil)
130
- end
131
-
132
- context "when there is no existing crontab" do
133
- before :each do
134
- @provider.cron_exists = false
135
- @provider.cron_empty = true
136
- end
137
-
138
- it "should create a crontab with the entry" do
139
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
140
- # Chef Name: cronhole some stuff
141
- @reboot /bin/true
142
- ENDCRON
143
- @provider.run_action(:create)
144
- end
145
- end
146
- end
147
- end
148
- end
149
-
150
- describe "when examining the current system state" do
151
- context "with no crontab for the user" do
152
- before :each do
153
- allow(@provider).to receive(:read_crontab).and_return(nil)
154
- end
155
-
156
- it "should set cron_empty" do
157
- @provider.load_current_resource
158
- expect(@provider.cron_empty).to eq(true)
159
- expect(@provider.cron_exists).to eq(false)
160
- end
161
-
162
- it "should report an empty crontab" do
163
- expect(logger).to receive(:trace).with("Cron empty for '#{@new_resource.user}'")
164
- @provider.load_current_resource
165
- end
166
- end
167
-
168
- context "with no matching entry in the user's crontab" do
169
- before :each do
170
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
171
- 0 2 * * * /some/other/command
172
-
173
- # Chef Name: something else
174
- * 5 * * * /bin/true
175
-
176
- # Another comment
177
- CRONTAB
178
- end
179
-
180
- it "should not set cron_exists or cron_empty" do
181
- @provider.load_current_resource
182
- expect(@provider.cron_exists).to eq(false)
183
- expect(@provider.cron_empty).to eq(false)
184
- end
185
-
186
- it "should report no entry found" do
187
- expect(logger).to receive(:trace).with("Cron '#{@new_resource.name}' not found")
188
- @provider.load_current_resource
189
- end
190
-
191
- it "should not fail if there's an existing cron with a numerical argument" do
192
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
193
- # Chef Name: foo[bar] (baz)
194
- 21 */4 * * * some_prog 1234567
195
- CRONTAB
196
- expect do
197
- @provider.load_current_resource
198
- end.not_to raise_error
199
- end
200
- end
201
-
202
- context "with a matching entry in the user's crontab" do
203
- before :each do
204
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
205
- 0 2 * * * /some/other/command
206
-
207
- # Chef Name: cronhole some stuff
208
- * 5 * 1 * /bin/true param1 param2
209
- # Chef Name: something else
210
- 2 * 1 * * /bin/false
211
-
212
- # Another comment
213
- CRONTAB
214
- end
215
-
216
- it "should set cron_exists" do
217
- @provider.load_current_resource
218
- expect(@provider.cron_exists).to eq(true)
219
- expect(@provider.cron_empty).to eq(false)
220
- end
221
-
222
- it "should pull the details out of the cron line" do
223
- cron = @provider.load_current_resource
224
- expect(cron.minute).to eq("*")
225
- expect(cron.hour).to eq("5")
226
- expect(cron.day).to eq("*")
227
- expect(cron.month).to eq("1")
228
- expect(cron.weekday).to eq("*")
229
- expect(cron.time).to eq(nil)
230
- expect(cron.command).to eq("/bin/true param1 param2")
231
- end
232
-
233
- it "should pull env vars out" do
234
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
235
- 0 2 * * * /some/other/command
236
-
237
- # Chef Name: cronhole some stuff
238
- MAILTO=foo@example.com
239
- SHELL=/bin/foosh
240
- PATH=/bin:/foo
241
- HOME=/home/foo
242
- * 5 * 1 * /bin/true param1 param2
243
- # Chef Name: something else
244
- 2 * 1 * * /bin/false
245
-
246
- # Another comment
247
- CRONTAB
248
- cron = @provider.load_current_resource
249
- expect(cron.mailto).to eq("foo@example.com")
250
- expect(cron.shell).to eq("/bin/foosh")
251
- expect(cron.path).to eq("/bin:/foo")
252
- expect(cron.home).to eq("/home/foo")
253
- expect(cron.minute).to eq("*")
254
- expect(cron.hour).to eq("5")
255
- expect(cron.day).to eq("*")
256
- expect(cron.month).to eq("1")
257
- expect(cron.weekday).to eq("*")
258
- expect(cron.time).to eq(nil)
259
- expect(cron.command).to eq("/bin/true param1 param2")
260
- end
261
-
262
- it "should parse and load generic and standard environment variables from cron entry" do
263
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
264
- # Chef Name: cronhole some stuff
265
- MAILTO=warn@example.com
266
- TEST=lol
267
- FLAG=1
268
- * 5 * * * /bin/true
269
- CRONTAB
270
- cron = @provider.load_current_resource
271
-
272
- expect(cron.mailto).to eq("warn@example.com")
273
- expect(cron.environment).to eq({ "TEST" => "lol", "FLAG" => "1" })
274
- end
275
-
276
- it "should not break with variabels that match the cron resource internals" do
277
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
278
- # Chef Name: cronhole some stuff
279
- MINUTE=40
280
- HOUR=midnight
281
- TEST=lol
282
- ENVIRONMENT=production
283
- * 5 * * * /bin/true
284
- CRONTAB
285
- cron = @provider.load_current_resource
286
-
287
- expect(cron.minute).to eq("*")
288
- expect(cron.hour).to eq("5")
289
- expect(cron.environment).to eq({ "MINUTE" => "40", "HOUR" => "midnight", "TEST" => "lol", "ENVIRONMENT" => "production" })
290
- end
291
-
292
- it "should report the match" do
293
- expect(logger).to receive(:trace).with("Found cron '#{@new_resource.name}'")
294
- @provider.load_current_resource
295
- end
296
- end
297
-
298
- context "with a matching entry in the user's crontab using month names and weekday names (#CHEF-3178)" do
299
- before :each do
300
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
301
- 0 2 * * * /some/other/command
302
-
303
- # Chef Name: cronhole some stuff
304
- * 5 * Jan Mon /bin/true param1 param2
305
- # Chef Name: something else
306
- 2 * 1 * * /bin/false
307
-
308
- # Another comment
309
- CRONTAB
310
- end
311
-
312
- it "should set cron_exists" do
313
- @provider.load_current_resource
314
- expect(@provider.cron_exists).to eq(true)
315
- expect(@provider.cron_empty).to eq(false)
316
- end
317
-
318
- it "should pull the details out of the cron line" do
319
- cron = @provider.load_current_resource
320
- expect(cron.minute).to eq("*")
321
- expect(cron.hour).to eq("5")
322
- expect(cron.day).to eq("*")
323
- expect(cron.month).to eq("Jan")
324
- expect(cron.weekday).to eq("1")
325
- expect(cron.command).to eq("/bin/true param1 param2")
326
- end
327
-
328
- it "should report the match" do
329
- expect(logger).to receive(:trace).with("Found cron '#{@new_resource.name}'")
330
- @provider.load_current_resource
331
- end
332
- end
333
-
334
- context "with a matching entry without a crontab line" do
335
- it "should set cron_exists and leave current_resource values at defaults" do
336
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
337
- 0 2 * * * /some/other/command
338
-
339
- # Chef Name: cronhole some stuff
340
- * * * * * /bin/true
341
- CRONTAB
342
- cron = @provider.load_current_resource
343
- expect(@provider.cron_exists).to eq(true)
344
- expect(cron.minute).to eq("*")
345
- expect(cron.hour).to eq("*")
346
- expect(cron.day).to eq("*")
347
- expect(cron.month).to eq("*")
348
- expect(cron.weekday).to eq("*")
349
- expect(cron.time).to eq(nil)
350
- expect(cron.command).to eq("/bin/true")
351
- end
352
-
353
- it "should not pick up a commented out crontab line" do
354
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
355
- 0 2 * * * /some/other/command
356
-
357
- # Chef Name: cronhole some stuff
358
- * * * * * /bin/true
359
- #* 5 * 1 * /bin/true param1 param2
360
- CRONTAB
361
- cron = @provider.load_current_resource
362
- expect(@provider.cron_exists).to eq(true)
363
- expect(cron.minute).to eq("*")
364
- expect(cron.hour).to eq("*")
365
- expect(cron.day).to eq("*")
366
- expect(cron.month).to eq("*")
367
- expect(cron.weekday).to eq("*")
368
- expect(cron.time).to eq(nil)
369
- expect(cron.command).to eq("/bin/true")
370
- end
371
-
372
- it "should not pick up a later crontab entry" do
373
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
374
- 0 2 * * * /some/other/command
375
-
376
- # Chef Name: cronhole some stuff
377
- * * * * * /bin/true
378
- #* 5 * 1 * /bin/true param1 param2
379
- # Chef Name: something else
380
- 2 * 1 * * /bin/false
381
-
382
- # Another comment
383
- CRONTAB
384
- cron = @provider.load_current_resource
385
- expect(@provider.cron_exists).to eq(true)
386
- expect(cron.minute).to eq("*")
387
- expect(cron.hour).to eq("*")
388
- expect(cron.day).to eq("*")
389
- expect(cron.month).to eq("*")
390
- expect(cron.weekday).to eq("*")
391
- expect(cron.time).to eq(nil)
392
- expect(cron.command).to eq("/bin/true")
393
- end
394
- end
395
-
396
- context "with a matching entry with a commented crontab line" do
397
- it "should set cron_exists" do
398
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
399
- 0 2 * * * /some/other/command
400
-
401
- # Chef Name: cronhole some stuff
402
- #* * * * * /bin/true
403
- CRONTAB
404
- cron = @provider.load_current_resource
405
- expect(@provider.cron_exists).to eq(true)
406
- expect(@provider.cron_empty).to eq(false)
407
- expect(cron.minute).to eq("*")
408
- expect(cron.hour).to eq("*")
409
- expect(cron.day).to eq("*")
410
- expect(cron.month).to eq("*")
411
- expect(cron.weekday).to eq("*")
412
- expect(cron.time).to eq(nil)
413
- expect(cron.property_is_set?(:command)).to eq(false)
414
- end
415
- end
416
- end
417
-
418
- describe "cron_different?" do
419
- before :each do
420
- @current_resource = Chef::Resource::Cron.new("cronhole some stuff")
421
- @current_resource.user "root"
422
- @current_resource.minute "30"
423
- @current_resource.command "/bin/true"
424
- @provider.current_resource = @current_resource
425
- end
426
-
427
- %i{minute hour day month weekday command mailto path shell home}.each do |property|
428
- it "should return true if #{property} doesn't match" do
429
- @new_resource.send(property, "1") # we use 1 in order to pass resource validation. We're just using a value that's different.
430
- expect(@provider.cron_different?).to eql(true)
431
- end
432
- end
433
-
434
- it "should return true if special time string doesn't match" do
435
- @new_resource.send(:time, :reboot)
436
- expect(@provider.cron_different?).to eql(true)
437
- end
438
-
439
- it "should return true if environment doesn't match" do
440
- @new_resource.environment "FOO" => "something_else"
441
- expect(@provider.cron_different?).to eql(true)
442
- end
443
-
444
- it "should return true if mailto doesn't match" do
445
- @current_resource.mailto "foo@bar.com"
446
- @new_resource.mailto(nil)
447
- expect(@provider.cron_different?).to eql(true)
448
- end
449
-
450
- it "should return false if the objects are identical" do
451
- expect(@provider.cron_different?).to eq(false)
452
- end
453
- end
454
-
455
- describe "action_create" do
456
- before :each do
457
- allow(@provider).to receive(:write_crontab)
458
- allow(@provider).to receive(:read_crontab).and_return(nil)
459
- end
460
-
461
- context "when there is no existing crontab" do
462
- before :each do
463
- @provider.cron_exists = false
464
- @provider.cron_empty = true
465
- end
466
-
467
- it "should create a crontab with the entry" do
468
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
469
- # Chef Name: cronhole some stuff
470
- 30 * * * * /bin/true
471
- ENDCRON
472
- @provider.run_action(:create)
473
- end
474
-
475
- it "should include env variables that are set" do
476
- @new_resource.mailto "foo@example.com"
477
- @new_resource.path "/usr/bin:/my/custom/path"
478
- @new_resource.shell "/bin/foosh"
479
- @new_resource.home "/home/foo"
480
- @new_resource.environment "TEST" => "LOL"
481
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
482
- # Chef Name: cronhole some stuff
483
- MAILTO="foo@example.com"
484
- PATH="/usr/bin:/my/custom/path"
485
- SHELL="/bin/foosh"
486
- HOME="/home/foo"
487
- TEST=LOL
488
- 30 * * * * /bin/true
489
- ENDCRON
490
- @provider.run_action(:create)
491
- end
492
-
493
- it "should mark the resource as updated" do
494
- @provider.run_action(:create)
495
- expect(@new_resource).to be_updated_by_last_action
496
- end
497
-
498
- it "should log the action" do
499
- expect(logger).to receive(:info).with("cron[cronhole some stuff] added crontab entry")
500
- @provider.run_action(:create)
501
- end
502
- end
503
-
504
- context "when there is a crontab with no matching section" do
505
- before :each do
506
- @provider.cron_exists = false
507
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
508
- 0 2 * * * /some/other/command
509
-
510
- # Chef Name: something else
511
- 2 * 1 * * /bin/false
512
-
513
- # Another comment
514
- CRONTAB
515
- end
516
-
517
- it "should add the entry to the crontab" do
518
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
519
- 0 2 * * * /some/other/command
520
-
521
- # Chef Name: something else
522
- 2 * 1 * * /bin/false
523
-
524
- # Another comment
525
- # Chef Name: cronhole some stuff
526
- 30 * * * * /bin/true
527
- ENDCRON
528
- @provider.run_action(:create)
529
- end
530
-
531
- it "should include env variables that are set" do
532
- @new_resource.mailto "foo@example.com"
533
- @new_resource.path "/usr/bin:/my/custom/path"
534
- @new_resource.shell "/bin/foosh"
535
- @new_resource.home "/home/foo"
536
- @new_resource.environment "TEST" => "LOL"
537
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
538
- 0 2 * * * /some/other/command
539
-
540
- # Chef Name: something else
541
- 2 * 1 * * /bin/false
542
-
543
- # Another comment
544
- # Chef Name: cronhole some stuff
545
- MAILTO="foo@example.com"
546
- PATH="/usr/bin:/my/custom/path"
547
- SHELL="/bin/foosh"
548
- HOME="/home/foo"
549
- TEST=LOL
550
- 30 * * * * /bin/true
551
- ENDCRON
552
- @provider.run_action(:create)
553
- end
554
-
555
- it "should mark the resource as updated" do
556
- @provider.run_action(:create)
557
- expect(@new_resource).to be_updated_by_last_action
558
- end
559
-
560
- it "should log the action" do
561
- expect(logger).to receive(:info).with("cron[cronhole some stuff] added crontab entry")
562
- @provider.run_action(:create)
563
- end
564
- end
565
-
566
- context "when there is a crontab with a matching but different section" do
567
- before :each do
568
- @provider.cron_exists = true
569
- allow(@provider).to receive(:cron_different?).and_return(true)
570
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
571
- 0 2 * * * /some/other/command
572
-
573
- # Chef Name: cronhole some stuff
574
- 30 * * 3 * /bin/true
575
- # Chef Name: something else
576
- 2 * 1 * * /bin/false
577
-
578
- # Another comment
579
- CRONTAB
580
- end
581
-
582
- it "should update the crontab entry" do
583
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
584
- 0 2 * * * /some/other/command
585
-
586
- # Chef Name: cronhole some stuff
587
- 30 * * * * /bin/true
588
- # Chef Name: something else
589
- 2 * 1 * * /bin/false
590
-
591
- # Another comment
592
- ENDCRON
593
- @provider.run_action(:create)
594
- end
595
-
596
- it "should include env variables that are set" do
597
- @new_resource.mailto "foo@example.com"
598
- @new_resource.path "/usr/bin:/my/custom/path"
599
- @new_resource.shell "/bin/foosh"
600
- @new_resource.home "/home/foo"
601
- @new_resource.environment "TEST" => "LOL"
602
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
603
- 0 2 * * * /some/other/command
604
-
605
- # Chef Name: cronhole some stuff
606
- MAILTO="foo@example.com"
607
- PATH="/usr/bin:/my/custom/path"
608
- SHELL="/bin/foosh"
609
- HOME="/home/foo"
610
- TEST=LOL
611
- 30 * * * * /bin/true
612
- # Chef Name: something else
613
- 2 * 1 * * /bin/false
614
-
615
- # Another comment
616
- ENDCRON
617
- @provider.run_action(:create)
618
- end
619
-
620
- it "should mark the resource as updated" do
621
- @provider.run_action(:create)
622
- expect(@new_resource).to be_updated_by_last_action
623
- end
624
-
625
- it "should log the action" do
626
- expect(logger).to receive(:info).with("cron[cronhole some stuff] updated crontab entry")
627
- @provider.run_action(:create)
628
- end
629
- end
630
-
631
- context "when there is a crontab with a matching section with no crontab line in it" do
632
- before :each do
633
- @provider.cron_exists = true
634
- allow(@provider).to receive(:cron_different?).and_return(true)
635
- end
636
-
637
- it "should add the crontab to the entry" do
638
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
639
- 0 2 * * * /some/other/command
640
-
641
- # Chef Name: cronhole some stuff
642
- CRONTAB
643
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
644
- 0 2 * * * /some/other/command
645
-
646
- # Chef Name: cronhole some stuff
647
- 30 * * * * /bin/true
648
- ENDCRON
649
- @provider.run_action(:create)
650
- end
651
-
652
- it "should not blat any following entries" do
653
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
654
- 0 2 * * * /some/other/command
655
-
656
- # Chef Name: cronhole some stuff
657
- #30 * * * * /bin/true
658
- # Chef Name: something else
659
- 2 * 1 * * /bin/false
660
-
661
- # Another comment
662
- CRONTAB
663
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
664
- 0 2 * * * /some/other/command
665
-
666
- # Chef Name: cronhole some stuff
667
- 30 * * * * /bin/true
668
- #30 * * * * /bin/true
669
- # Chef Name: something else
670
- 2 * 1 * * /bin/false
671
-
672
- # Another comment
673
- ENDCRON
674
- @provider.run_action(:create)
675
- end
676
-
677
- it "should handle env vars with no crontab" do
678
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
679
- 0 2 * * * /some/other/command
680
-
681
- # Chef Name: cronhole some stuff
682
- MAILTO=bar@example.com
683
- PATH=/usr/bin:/my/custom/path
684
- SHELL=/bin/barsh
685
- HOME=/home/foo
686
-
687
- # Chef Name: something else
688
- 2 * 1 * * /bin/false
689
-
690
- # Another comment
691
- CRONTAB
692
- @new_resource.mailto "foo@example.com"
693
- @new_resource.path "/usr/bin:/my/custom/path"
694
- @new_resource.shell "/bin/foosh"
695
- @new_resource.home "/home/foo"
696
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
697
- 0 2 * * * /some/other/command
698
-
699
- # Chef Name: cronhole some stuff
700
- MAILTO="foo@example.com"
701
- PATH="/usr/bin:/my/custom/path"
702
- SHELL="/bin/foosh"
703
- HOME="/home/foo"
704
- 30 * * * * /bin/true
705
-
706
- # Chef Name: something else
707
- 2 * 1 * * /bin/false
708
-
709
- # Another comment
710
- ENDCRON
711
- @provider.run_action(:create)
712
- end
713
- end
714
-
715
- context "when there is a crontab with a matching section with a commented crontab line in it" do
716
- before :each do
717
- @provider.cron_exists = true
718
- end
719
-
720
- it "should add the crontab to the entry" do
721
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
722
- 0 2 * * * /some/other/command
723
-
724
- # Chef Name: cronhole some stuff
725
- # * * * * * /bin/true
726
- CRONTAB
727
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
728
- 0 2 * * * /some/other/command
729
-
730
- # Chef Name: cronhole some stuff
731
- * * * * * /bin/true
732
- # * * * * * /bin/true
733
- ENDCRON
734
- @new_resource.minute "*"
735
- @provider.run_action(:create)
736
- end
737
- end
738
-
739
- context "when there is a crontab with a matching and identical section" do
740
- context "when environment variable is not used" do
741
- before :each do
742
- @provider.cron_exists = true
743
- allow(@provider).to receive(:cron_different?).and_return(false)
744
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
745
- 0 2 * * * /some/other/command
746
-
747
- # Chef Name: cronhole some stuff
748
- SHELL=/bash
749
- * 5 * * * /bin/true
750
-
751
- # Another comment
752
- CRONTAB
753
- end
754
-
755
- it "should not update the crontab" do
756
- expect(@provider).not_to receive(:write_crontab)
757
- @provider.run_action(:create)
758
- end
759
-
760
- it "should not mark the resource as updated" do
761
- @provider.run_action(:create)
762
- expect(@new_resource).not_to be_updated_by_last_action
763
- end
764
-
765
- it "should log nothing changed" do
766
- expect(logger).to receive(:trace).with("Found cron '#{@new_resource.name}'")
767
- expect(logger).to receive(:debug).with("#{@new_resource}: Skipping existing cron entry")
768
- @provider.run_action(:create)
769
- end
770
- end
771
-
772
- context "when integers are provided to the resource to express time values" do
773
- it "should not report any difference" do
774
- @new_resource.minute(1)
775
- @new_resource.hour(1)
776
- @new_resource.day(1)
777
- @new_resource.month(1)
778
- @new_resource.weekday(1)
779
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
780
- # Chef Name: cronhole some stuff
781
- 1 1 1 1 1 /bin/true
782
-
783
- CRONTAB
784
-
785
- @provider.run_action(:create)
786
- expect(@new_resource).not_to be_updated_by_last_action
787
- end
788
- end
789
-
790
- context "when strings are provided to the resource to express time values" do
791
- it "should not report any difference" do
792
- @new_resource.minute("1")
793
- @new_resource.hour("1")
794
- @new_resource.day("1")
795
- @new_resource.month("1")
796
- @new_resource.weekday("1")
797
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
798
- # Chef Name: cronhole some stuff
799
- 1 1 1 1 1 /bin/true
800
-
801
- CRONTAB
802
-
803
- @provider.run_action(:create)
804
- expect(@new_resource).not_to be_updated_by_last_action
805
- end
806
- end
807
-
808
- context "when environment variable is used" do
809
- before :each do
810
- @provider.cron_exists = true
811
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
812
- 0 2 * * * /some/other/command
813
-
814
- # Chef Name: cronhole some stuff
815
- SHELL=/bash
816
- ENV=environment
817
- 30 * * * * /bin/true
818
-
819
- # Another comment
820
- CRONTAB
821
- end
822
- context "contains an entry that can also be specified as a `property`" do
823
- before :each do
824
- @new_resource.environment = { "SHELL" => "/bash", "ENV" => "environment" }
825
- end
826
-
827
- it "should raise a warning for idempotency" do
828
- expect(logger).to receive(:warn).with("cronhole some stuff: the environment property contains the 'SHELL' variable, which should be set separately as a property.")
829
- @provider.run_action(:create)
830
- end
831
-
832
- it "should not update the crontab" do
833
- expect(@provider).not_to receive(:write_crontab)
834
- @provider.run_action(:create)
835
- end
836
-
837
- it "should not mark the resource as updated" do
838
- expect(@new_resource).not_to be_updated_by_last_action
839
- @provider.run_action(:create)
840
- end
841
- end
842
-
843
- context "contains an entry that cannot be specified as a `property`" do
844
- before :each do
845
- @new_resource.environment = { "ENV" => "environment" }
846
- @new_resource.shell "/bash"
847
- end
848
-
849
- it "should not raise a warning for idempotency" do
850
- expect(logger).not_to receive(:warn).with("cronhole some stuff: the environment property contains the 'SHELL' variable, which should be set separately as a property.")
851
- @provider.run_action(:create)
852
- end
853
-
854
- it "should not update the crontab" do
855
- expect(@provider).not_to receive(:write_crontab)
856
- @provider.run_action(:create)
857
- end
858
-
859
- it "should not mark the resource as updated" do
860
- @provider.run_action(:create)
861
- expect(@new_resource).not_to be_updated_by_last_action
862
- end
863
- end
864
- end
865
-
866
- context "when environment variable is used with property" do
867
- before :each do
868
- @provider.cron_exists = true
869
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
870
- 0 2 * * * /some/other/command
871
-
872
- # Chef Name: cronhole some stuff
873
- SHELL=/bash
874
- ENV=environment
875
- 30 * * * * /bin/true
876
-
877
- # Another comment
878
- CRONTAB
879
- end
880
-
881
- context "when environment variable is same as property" do
882
- it "should throw an error" do
883
- @new_resource.shell "/bash"
884
- @new_resource.environment "SHELL" => "/bash"
885
- expect do
886
- @provider.run_action(:create)
887
- end.to raise_error(Chef::Exceptions::Cron, /cronhole some stuff: the 'SHELL' property is set and environment property also contains the 'SHELL' variable. Remove the variable from the environment property./)
888
- end
889
- end
890
-
891
- context "when environment variable is different from property" do
892
- it "should not update the crontab" do
893
- @new_resource.shell "/bash"
894
- @new_resource.environment "ENV" => "environment"
895
- expect(@provider).not_to receive(:write_crontab)
896
- @provider.run_action(:create)
897
- end
898
-
899
- it "should not mark the resource as updated" do
900
- @new_resource.shell "/bash"
901
- @new_resource.environment "ENV" => "environment"
902
- @provider.run_action(:create)
903
- expect(@new_resource).not_to be_updated_by_last_action
904
- end
905
- end
906
- end
907
- end
908
- end
909
-
910
- describe "action_delete" do
911
- before :each do
912
- allow(@provider).to receive(:write_crontab)
913
- allow(@provider).to receive(:read_crontab).and_return(nil)
914
- end
915
-
916
- context "when the user's crontab has no matching section" do
917
- before :each do
918
- @provider.cron_exists = false
919
- end
920
-
921
- it "should do nothing" do
922
- expect(@provider).not_to receive(:write_crontab)
923
- expect(logger).not_to receive(:info)
924
- @provider.run_action(:delete)
925
- end
926
-
927
- it "should not mark the resource as updated" do
928
- @provider.run_action(:delete)
929
- expect(@new_resource).not_to be_updated_by_last_action
930
- end
931
- end
932
-
933
- context "when the user has a crontab with a matching section" do
934
- before :each do
935
- @provider.cron_exists = true
936
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
937
- 0 2 * * * /some/other/command
938
-
939
- # Chef Name: cronhole some stuff
940
- 30 * * 3 * /bin/true
941
- # Chef Name: something else
942
- 2 * 1 * * /bin/false
943
-
944
- # Another comment
945
- CRONTAB
946
- end
947
-
948
- it "should remove the entry" do
949
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
950
- 0 2 * * * /some/other/command
951
-
952
- # Chef Name: something else
953
- 2 * 1 * * /bin/false
954
-
955
- # Another comment
956
- ENDCRON
957
- @provider.run_action(:delete)
958
- end
959
-
960
- it "should remove any env vars with the entry" do
961
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
962
- 0 2 * * * /some/other/command
963
-
964
- # Chef Name: cronhole some stuff
965
- MAILTO=foo@example.com
966
- FOO=test
967
- 30 * * 3 * /bin/true
968
- # Chef Name: something else
969
- 2 * 1 * * /bin/false
970
-
971
- # Another comment
972
- CRONTAB
973
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
974
- 0 2 * * * /some/other/command
975
-
976
- # Chef Name: something else
977
- 2 * 1 * * /bin/false
978
-
979
- # Another comment
980
- ENDCRON
981
- @provider.run_action(:delete)
982
- end
983
-
984
- it "should mark the resource as updated" do
985
- @provider.run_action(:delete)
986
- expect(@new_resource).to be_updated_by_last_action
987
- end
988
-
989
- it "should log the action" do
990
- expect(logger).to receive(:info).with("#{@new_resource} deleted crontab entry")
991
- @provider.run_action(:delete)
992
- end
993
- end
994
-
995
- context "when the crontab has a matching section with no crontab line" do
996
- before :each do
997
- @provider.cron_exists = true
998
- end
999
-
1000
- it "should remove the section" do
1001
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
1002
- 0 2 * * * /some/other/command
1003
-
1004
- # Chef Name: cronhole some stuff
1005
- CRONTAB
1006
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
1007
- 0 2 * * * /some/other/command
1008
-
1009
- ENDCRON
1010
- @provider.run_action(:delete)
1011
- end
1012
-
1013
- it "should not blat following sections" do
1014
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
1015
- 0 2 * * * /some/other/command
1016
-
1017
- # Chef Name: cronhole some stuff
1018
- #30 * * 3 * /bin/true
1019
- # Chef Name: something else
1020
- 2 * 1 * * /bin/false
1021
-
1022
- # Another comment
1023
- CRONTAB
1024
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
1025
- 0 2 * * * /some/other/command
1026
-
1027
- #30 * * 3 * /bin/true
1028
- # Chef Name: something else
1029
- 2 * 1 * * /bin/false
1030
-
1031
- # Another comment
1032
- ENDCRON
1033
- @provider.run_action(:delete)
1034
- end
1035
-
1036
- it "should remove any envvars with the section" do
1037
- allow(@provider).to receive(:read_crontab).and_return(<<~CRONTAB)
1038
- 0 2 * * * /some/other/command
1039
-
1040
- # Chef Name: cronhole some stuff
1041
- MAILTO=foo@example.com
1042
- #30 * * 3 * /bin/true
1043
- # Chef Name: something else
1044
- 2 * 1 * * /bin/false
1045
-
1046
- # Another comment
1047
- CRONTAB
1048
- expect(@provider).to receive(:write_crontab).with(<<~ENDCRON)
1049
- 0 2 * * * /some/other/command
1050
-
1051
- #30 * * 3 * /bin/true
1052
- # Chef Name: something else
1053
- 2 * 1 * * /bin/false
1054
-
1055
- # Another comment
1056
- ENDCRON
1057
- @provider.run_action(:delete)
1058
- end
1059
- end
1060
- end
1061
-
1062
- describe "read_crontab" do
1063
- before :each do
1064
- @stdout = <<~CRONTAB
1065
- 0 2 * * * /some/other/command
1066
-
1067
- # Chef Name: something else
1068
- * 5 * * * /bin/true
1069
-
1070
- # Another comment
1071
- CRONTAB
1072
- @status = double("Status", exitstatus: 0, stdout: @stdout)
1073
- allow(@provider).to receive(:shell_out!).and_return(@status)
1074
- end
1075
-
1076
- it "should call crontab -l with the user" do
1077
- expect(@provider).to receive(:shell_out!).with("crontab -l -u #{@new_resource.user}", returns: [0, 1]).and_return(@status)
1078
- @provider.send(:read_crontab)
1079
- end
1080
-
1081
- it "should return the contents of the crontab" do
1082
- crontab = @provider.send(:read_crontab)
1083
- expect(crontab).to eq <<~CRONTAB
1084
- 0 2 * * * /some/other/command
1085
-
1086
- # Chef Name: something else
1087
- * 5 * * * /bin/true
1088
-
1089
- # Another comment
1090
- CRONTAB
1091
- end
1092
-
1093
- it "should return nil if the user has no crontab" do
1094
- @status = double("Status", exitstatus: 1, stdout: "")
1095
- allow(@provider).to receive(:shell_out!).and_return(@status)
1096
- expect(@provider.send(:read_crontab)).to eq(nil)
1097
- end
1098
-
1099
- it "should raise an exception if another error occurs" do
1100
- @status = double("Status", exitstatus: 2)
1101
- allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
1102
- expect { @provider.send(:read_crontab) }.to raise_error(Chef::Exceptions::Cron)
1103
- end
1104
- end
1105
-
1106
- describe "write_crontab" do
1107
- before :each do
1108
- @status = double("Status", exitstatus: 0)
1109
- allow(@provider).to receive(:shell_out!).and_return(@status)
1110
- end
1111
-
1112
- it "should call crontab for the user" do
1113
- expect(@provider).to receive(:shell_out!).with("crontab -u #{@new_resource.user} -", input: "Foo").and_return(@status)
1114
- @provider.send(:write_crontab, "Foo")
1115
- end
1116
-
1117
- it "should raise an exception if the command returns non-zero" do
1118
- @status = double("Status", exitstatus: 1)
1119
- allow(@provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
1120
- expect do
1121
- @provider.send(:write_crontab, "Foo")
1122
- end.to raise_error(Chef::Exceptions::Cron)
1123
- end
1124
- end
1125
-
1126
- describe "#env_var_str" do
1127
- context "when no env vars are set" do
1128
- it "returns an empty string" do
1129
- expect(@provider.send(:env_var_str)).to be_empty
1130
- end
1131
- end
1132
- let(:mailto) { "foo@example.com" }
1133
- context "When set directly" do
1134
- it "returns string with value" do
1135
- @new_resource.mailto mailto
1136
- expect(@provider.send(:env_var_str)).to include(mailto)
1137
- end
1138
- end
1139
- context "When set within the hash" do
1140
- context "env properties" do
1141
- it "returns string with a warning" do
1142
- @new_resource.environment "MAILTO" => mailto
1143
- expect(logger).to receive(:warn).with("cronhole some stuff: the environment property contains the 'MAILTO' variable, which should be set separately as a property.")
1144
- expect(@provider.send(:env_var_str)).to include(mailto)
1145
- end
1146
- end
1147
- context "other properties" do
1148
- it "returns string with no warning" do
1149
- @new_resource.environment "FOOMAILTO" => mailto
1150
- expect(logger).not_to receive(:warn).with("cronhole some stuff: the environment property contains the 'MAILTO' variable, which should be set separately as a property.")
1151
- expect(@provider.send(:env_var_str)).to include(mailto)
1152
- end
1153
- it "and a line break within properties" do
1154
- @new_resource.environment "FOOMAILTO" => mailto, "BARMAILTO" => mailto
1155
- expect(@provider.send(:env_var_str)).to eq("FOOMAILTO=foo@example.com\nBARMAILTO=foo@example.com")
1156
- end
1157
- end
1158
- context "both env and other properties" do
1159
- it "returns string with line break within the properties" do
1160
- @new_resource.mailto mailto
1161
- @new_resource.environment "FOOMAILTO" => mailto
1162
- expect(@provider.send(:env_var_str)).to eq("MAILTO=\"foo@example.com\"\nFOOMAILTO=foo@example.com")
1163
- end
1164
- end
1165
- end
1166
- end
1167
-
1168
- describe "#duration_str" do
1169
- context "time as a frequency" do
1170
- it "returns string" do
1171
- @new_resource.time :yearly
1172
- expect(@provider.send(:duration_str)).to eq("@yearly")
1173
- end
1174
- end
1175
- context "time as a duration" do
1176
- it "defaults to * (No Specific Value)" do
1177
- @new_resource.minute "1"
1178
- expect(@provider.send(:duration_str)).to eq("1 * * * *")
1179
- end
1180
- it "returns cron format string" do
1181
- @new_resource.minute "1"
1182
- @new_resource.hour "2"
1183
- @new_resource.day "3"
1184
- @new_resource.month "4"
1185
- @new_resource.weekday "5"
1186
- expect(@provider.send(:duration_str)).to eq("1 2 3 4 5")
1187
- end
1188
- end
1189
- end
1190
-
1191
- describe "#time_out_str" do
1192
- context "When not given" do
1193
- it "Returns an empty string" do
1194
- expect(@provider.send(:time_out_str)).to be_empty
1195
- end
1196
- end
1197
- context "When given" do
1198
- let(:time_out_str_val) { " timeout 10;" }
1199
- context "as String" do
1200
- it "returns string" do
1201
- @new_resource.time_out "10"
1202
- expect(@provider.send(:time_out_str)).to eq time_out_str_val
1203
- end
1204
- end
1205
- context "as Integer" do
1206
- it "returns string" do
1207
- @new_resource.time_out "10"
1208
- expect(@provider.send(:time_out_str)).to eq time_out_str_val
1209
- end
1210
- end
1211
- context "as Hash" do
1212
- it "returns string" do
1213
- @new_resource.time_out "duration" => "10"
1214
- expect(@provider.send(:time_out_str)).to eq time_out_str_val
1215
- end
1216
- it "also contains properties" do
1217
- @new_resource.time_out "duration" => "10", "foreground" => "true", "signal" => "FOO"
1218
- expect(@provider.send(:time_out_str)).to eq " timeout --foreground --signal FOO 10;"
1219
- end
1220
- end
1221
- end
1222
- end
1223
-
1224
- describe "#cmd_str" do
1225
- context "With command" do
1226
- let(:cmd) { "FOOBAR" }
1227
- before {
1228
- @new_resource.command cmd
1229
- }
1230
- it "returns a string with command" do
1231
- expect(@provider.send(:cmd_str)).to include(cmd)
1232
- end
1233
- it "string ends with a next line" do
1234
- expect(@provider.send(:cmd_str)[-1]).to eq("\n")
1235
- end
1236
- end
1237
- context "Without command, passed" do
1238
- context "as nil" do
1239
- it "returns an empty string with a next line" do
1240
- @new_resource.command "bin/true"
1241
- expect(@provider.send(:cmd_str)).to eq(" bin/true\n")
1242
- end
1243
- end
1244
- context "as an empty string" do
1245
- it "returns an empty string with a next line" do
1246
- @new_resource.command ""
1247
- expect(@provider.send(:cmd_str)).to eq(" \n")
1248
- end
1249
- end
1250
- end
1251
- end
1252
- end