puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (342) hide show
  1. data/CONTRIBUTING.md +5 -0
  2. data/Gemfile +17 -9
  3. data/README.md +1 -0
  4. data/conf/fileserver.conf +4 -3
  5. data/ext/README.environment +8 -0
  6. data/ext/build_defaults.yaml +1 -1
  7. data/ext/debian/control +2 -2
  8. data/ext/debian/puppet-common.dirs +4 -0
  9. data/ext/debian/rules +4 -0
  10. data/ext/emacs/puppet-mode-init.el +1 -1
  11. data/ext/emacs/puppet-mode.el +36 -17
  12. data/ext/redhat/client.init +3 -3
  13. data/ext/redhat/puppet.spec.erb +9 -0
  14. data/ext/systemd/puppet.service +3 -4
  15. data/ext/systemd/puppetmaster.service +1 -3
  16. data/install.rb +1 -1
  17. data/lib/puppet.rb +2 -1
  18. data/lib/puppet/agent.rb +1 -1
  19. data/lib/puppet/application.rb +17 -17
  20. data/lib/puppet/application/doc.rb +1 -1
  21. data/lib/puppet/configurer.rb +4 -1
  22. data/lib/puppet/configurer/downloader.rb +13 -12
  23. data/lib/puppet/configurer/plugin_handler.rb +3 -3
  24. data/lib/puppet/context.rb +6 -1
  25. data/lib/puppet/defaults.rb +82 -12
  26. data/lib/puppet/environments.rb +169 -13
  27. data/lib/puppet/external/nagios/grammar.ry +2 -0
  28. data/lib/puppet/external/nagios/parser.rb +28 -19
  29. data/lib/puppet/face/config.rb +19 -6
  30. data/lib/puppet/face/module/generate.rb +209 -7
  31. data/lib/puppet/face/module/install.rb +17 -16
  32. data/lib/puppet/face/module/list.rb +83 -82
  33. data/lib/puppet/face/module/search.rb +1 -1
  34. data/lib/puppet/face/module/upgrade.rb +10 -9
  35. data/lib/puppet/face/parser.rb +3 -2
  36. data/lib/puppet/face/plugin.rb +8 -4
  37. data/lib/puppet/file_bucket/dipper.rb +6 -3
  38. data/lib/puppet/file_bucket/file.rb +4 -2
  39. data/lib/puppet/file_serving/metadata.rb +1 -1
  40. data/lib/puppet/file_system/memory_file.rb +27 -1
  41. data/lib/puppet/file_system/memory_impl.rb +15 -1
  42. data/lib/puppet/forge.rb +148 -52
  43. data/lib/puppet/forge/cache.rb +5 -1
  44. data/lib/puppet/forge/errors.rb +10 -0
  45. data/lib/puppet/forge/repository.rb +61 -26
  46. data/lib/puppet/functions.rb +548 -0
  47. data/lib/puppet/functions/assert_type.rb +42 -0
  48. data/lib/puppet/functions/import.rb +7 -0
  49. data/lib/puppet/indirector/facts/facter.rb +1 -1
  50. data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
  51. data/lib/puppet/indirector/rest.rb +18 -0
  52. data/lib/puppet/loaders.rb +20 -0
  53. data/lib/puppet/module.rb +2 -2
  54. data/lib/puppet/module_tool.rb +40 -14
  55. data/lib/puppet/module_tool/applications.rb +0 -1
  56. data/lib/puppet/module_tool/applications/application.rb +35 -26
  57. data/lib/puppet/module_tool/applications/builder.rb +16 -6
  58. data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
  59. data/lib/puppet/module_tool/applications/installer.rb +196 -35
  60. data/lib/puppet/module_tool/applications/searcher.rb +1 -0
  61. data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
  62. data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
  63. data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
  64. data/lib/puppet/module_tool/checksums.rb +5 -8
  65. data/lib/puppet/module_tool/errors/installer.rb +12 -44
  66. data/lib/puppet/module_tool/errors/shared.rb +84 -11
  67. data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
  68. data/lib/puppet/module_tool/install_directory.rb +7 -6
  69. data/lib/puppet/module_tool/installed_modules.rb +92 -0
  70. data/lib/puppet/module_tool/local_tarball.rb +91 -0
  71. data/lib/puppet/module_tool/metadata.rb +119 -115
  72. data/lib/puppet/module_tool/modulefile.rb +9 -9
  73. data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
  74. data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
  75. data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
  76. data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
  77. data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
  78. data/lib/puppet/module_tool/tar.rb +3 -7
  79. data/lib/puppet/module_tool/tar/gnu.rb +21 -9
  80. data/lib/puppet/module_tool/tar/mini.rb +2 -8
  81. data/lib/puppet/network/http/api/v1.rb +1 -1
  82. data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
  83. data/lib/puppet/network/http/issues.rb +1 -0
  84. data/lib/puppet/network/http_pool.rb +15 -6
  85. data/lib/puppet/node/environment.rb +91 -20
  86. data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
  87. data/lib/puppet/parser/collector.rb +1 -1
  88. data/lib/puppet/parser/compiler.rb +50 -7
  89. data/lib/puppet/parser/functions.rb +6 -0
  90. data/lib/puppet/parser/functions/generate.rb +1 -1
  91. data/lib/puppet/parser/resource.rb +1 -1
  92. data/lib/puppet/pops.rb +22 -1
  93. data/lib/puppet/pops/adapters.rb +8 -1
  94. data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
  95. data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
  96. data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
  97. data/lib/puppet/pops/binder/producers.rb +2 -2
  98. data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
  99. data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
  100. data/lib/puppet/pops/evaluator/closure.rb +57 -2
  101. data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
  102. data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
  103. data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
  104. data/lib/puppet/pops/functions/dispatch.rb +71 -0
  105. data/lib/puppet/pops/functions/dispatcher.rb +237 -0
  106. data/lib/puppet/pops/functions/function.rb +77 -0
  107. data/lib/puppet/pops/issues.rb +12 -0
  108. data/lib/puppet/pops/loader/base_loader.rb +102 -0
  109. data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
  110. data/lib/puppet/pops/loader/gem_support.rb +49 -0
  111. data/lib/puppet/pops/loader/loader.rb +180 -0
  112. data/lib/puppet/pops/loader/loader_paths.rb +137 -0
  113. data/lib/puppet/pops/loader/module_loaders.rb +242 -0
  114. data/lib/puppet/pops/loader/null_loader.rb +44 -0
  115. data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
  116. data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
  117. data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
  118. data/lib/puppet/pops/loader/static_loader.rb +69 -0
  119. data/lib/puppet/pops/loader/uri_helper.rb +22 -0
  120. data/lib/puppet/pops/loaders.rb +240 -0
  121. data/lib/puppet/pops/model/factory.rb +13 -5
  122. data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
  123. data/lib/puppet/pops/parser/egrammar.ra +31 -18
  124. data/lib/puppet/pops/parser/eparser.rb +1137 -1106
  125. data/lib/puppet/pops/parser/lexer2.rb +17 -16
  126. data/lib/puppet/pops/semantic_error.rb +17 -0
  127. data/lib/puppet/pops/types/type_calculator.rb +150 -15
  128. data/lib/puppet/pops/types/type_factory.rb +69 -0
  129. data/lib/puppet/pops/types/type_parser.rb +9 -0
  130. data/lib/puppet/pops/types/types.rb +65 -4
  131. data/lib/puppet/pops/validation/checker4_0.rb +1 -1
  132. data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
  133. data/lib/puppet/property/list.rb +1 -1
  134. data/lib/puppet/provider/augeas/augeas.rb +2 -2
  135. data/lib/puppet/provider/cron/crontab.rb +13 -2
  136. data/lib/puppet/provider/package.rb +24 -0
  137. data/lib/puppet/provider/package/apt.rb +6 -1
  138. data/lib/puppet/provider/package/gem.rb +8 -2
  139. data/lib/puppet/provider/package/msi.rb +0 -15
  140. data/lib/puppet/provider/package/openbsd.rb +0 -24
  141. data/lib/puppet/provider/package/rpm.rb +3 -29
  142. data/lib/puppet/provider/package/windows.rb +0 -15
  143. data/lib/puppet/provider/package/yum.rb +101 -24
  144. data/lib/puppet/provider/package/yumhelper.py +31 -1
  145. data/lib/puppet/provider/package/zypper.rb +10 -28
  146. data/lib/puppet/provider/service/debian.rb +1 -1
  147. data/lib/puppet/provider/service/init.rb +3 -0
  148. data/lib/puppet/provider/service/openbsd.rb +318 -0
  149. data/lib/puppet/provider/service/redhat.rb +6 -3
  150. data/lib/puppet/provider/service/systemd.rb +2 -2
  151. data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
  152. data/lib/puppet/resource.rb +13 -9
  153. data/lib/puppet/resource/catalog.rb +12 -6
  154. data/lib/puppet/resource/type_collection.rb +3 -3
  155. data/lib/puppet/settings.rb +57 -36
  156. data/lib/puppet/settings/config_file.rb +5 -0
  157. data/lib/puppet/settings/environment_conf.rb +147 -0
  158. data/lib/puppet/settings/ttl_setting.rb +48 -0
  159. data/lib/puppet/ssl/certificate_authority.rb +2 -3
  160. data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
  161. data/lib/puppet/ssl/certificate_request.rb +4 -4
  162. data/lib/puppet/ssl/validator/default_validator.rb +2 -2
  163. data/lib/puppet/status.rb +1 -1
  164. data/lib/puppet/test/test_helper.rb +1 -0
  165. data/lib/puppet/type/augeas.rb +13 -1
  166. data/lib/puppet/type/cron.rb +32 -18
  167. data/lib/puppet/type/file.rb +4 -2
  168. data/lib/puppet/type/file/checksum.rb +15 -5
  169. data/lib/puppet/type/file/content.rb +3 -1
  170. data/lib/puppet/type/file/source.rb +5 -5
  171. data/lib/puppet/type/package.rb +12 -17
  172. data/lib/puppet/type/resources.rb +3 -1
  173. data/lib/puppet/type/scheduled_task.rb +4 -5
  174. data/lib/puppet/type/service.rb +12 -2
  175. data/lib/puppet/type/user.rb +106 -0
  176. data/lib/puppet/type/yumrepo.rb +9 -1
  177. data/lib/puppet/util/checksums.rb +60 -1
  178. data/lib/puppet/util/diff.rb +3 -1
  179. data/lib/puppet/util/execution.rb +20 -16
  180. data/lib/puppet/util/feature.rb +3 -0
  181. data/lib/puppet/util/logging.rb +19 -12
  182. data/lib/puppet/util/rubygems.rb +10 -0
  183. data/lib/puppet/util/watched_file.rb +1 -1
  184. data/lib/puppet/util/windows/security.rb +5 -3
  185. data/lib/puppet/vendor/load_semantic.rb +1 -0
  186. data/lib/puppet/vendor/require_vendored.rb +2 -0
  187. data/lib/puppet/vendor/semantic/Gemfile +20 -0
  188. data/lib/puppet/vendor/semantic/Rakefile +69 -0
  189. data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
  190. data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
  191. data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
  192. data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
  193. data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
  194. data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
  195. data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
  196. data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
  197. data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
  198. data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
  199. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
  200. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
  201. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
  202. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
  203. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
  204. data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
  205. data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
  206. data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
  207. data/lib/puppet/version.rb +1 -1
  208. data/spec/fixtures/java.tgz +0 -0
  209. data/spec/fixtures/stdlib.tgz +0 -0
  210. data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
  211. data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
  212. data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
  213. data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
  214. data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
  215. data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
  216. data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
  217. data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
  218. data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
  219. data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
  220. data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
  221. data/spec/fixtures/unit/type/user/authorized_keys +5 -0
  222. data/spec/integration/application/apply_spec.rb +1 -2
  223. data/spec/integration/configurer_spec.rb +2 -2
  224. data/spec/integration/faces/plugin_spec.rb +62 -0
  225. data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
  226. data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
  227. data/spec/integration/node/environment_spec.rb +2 -2
  228. data/spec/integration/parser/future_compiler_spec.rb +96 -142
  229. data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
  230. data/spec/integration/provider/cron/crontab_spec.rb +35 -0
  231. data/spec/integration/type/file_spec.rb +74 -72
  232. data/spec/integration/util/windows/security_spec.rb +17 -0
  233. data/spec/lib/matchers/resource.rb +45 -13
  234. data/spec/lib/puppet_spec/files.rb +18 -0
  235. data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
  236. data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
  237. data/spec/shared_contexts/checksums.rb +55 -0
  238. data/spec/unit/application/apply_spec.rb +10 -7
  239. data/spec/unit/application/doc_spec.rb +17 -10
  240. data/spec/unit/application/indirection_base_spec.rb +18 -10
  241. data/spec/unit/application/inspect_spec.rb +22 -20
  242. data/spec/unit/configurer/downloader_spec.rb +7 -6
  243. data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
  244. data/spec/unit/configurer_spec.rb +1 -1
  245. data/spec/unit/context_spec.rb +23 -0
  246. data/spec/unit/environments_spec.rb +274 -16
  247. data/spec/unit/face/config_spec.rb +111 -11
  248. data/spec/unit/face/module/install_spec.rb +14 -85
  249. data/spec/unit/face/module/list_spec.rb +108 -62
  250. data/spec/unit/face/module/search_spec.rb +1 -1
  251. data/spec/unit/face/module/uninstall_spec.rb +21 -42
  252. data/spec/unit/face/parser_spec.rb +5 -2
  253. data/spec/unit/file_bucket/dipper_spec.rb +92 -86
  254. data/spec/unit/file_bucket/file_spec.rb +23 -75
  255. data/spec/unit/file_serving/metadata_spec.rb +74 -74
  256. data/spec/unit/forge/module_release_spec.rb +131 -0
  257. data/spec/unit/forge/repository_spec.rb +21 -20
  258. data/spec/unit/forge_spec.rb +99 -23
  259. data/spec/unit/functions/assert_type_spec.rb +59 -0
  260. data/spec/unit/functions4_spec.rb +671 -0
  261. data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
  262. data/spec/unit/indirector/facts/facter_spec.rb +9 -3
  263. data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
  264. data/spec/unit/indirector/rest_spec.rb +8 -0
  265. data/spec/unit/interface/face_collection_spec.rb +35 -23
  266. data/spec/unit/module_spec.rb +20 -8
  267. data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
  268. data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
  269. data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
  270. data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
  271. data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
  272. data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
  273. data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
  274. data/spec/unit/module_tool/metadata_spec.rb +223 -14
  275. data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
  276. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  277. data/spec/unit/module_tool/tar_spec.rb +4 -18
  278. data/spec/unit/module_tool_spec.rb +123 -27
  279. data/spec/unit/network/formats_spec.rb +2 -2
  280. data/spec/unit/network/http_pool_spec.rb +21 -0
  281. data/spec/unit/network/rights_spec.rb +10 -8
  282. data/spec/unit/node/environment_spec.rb +27 -2
  283. data/spec/unit/parser/collector_spec.rb +1 -1
  284. data/spec/unit/parser/compiler_spec.rb +1 -1
  285. data/spec/unit/parser/functions/generate_spec.rb +4 -0
  286. data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
  287. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
  288. data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
  289. data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
  290. data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
  291. data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
  292. data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
  293. data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
  294. data/spec/unit/pops/types/type_factory_spec.rb +101 -0
  295. data/spec/unit/pops/types/type_parser_spec.rb +22 -0
  296. data/spec/unit/property/list_spec.rb +9 -1
  297. data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
  298. data/spec/unit/provider/cron/crontab_spec.rb +1 -0
  299. data/spec/unit/provider/cron/parsed_spec.rb +15 -0
  300. data/spec/unit/provider/naginator_spec.rb +14 -0
  301. data/spec/unit/provider/package/apt_spec.rb +78 -64
  302. data/spec/unit/provider/package/gem_spec.rb +15 -0
  303. data/spec/unit/provider/package/rpm_spec.rb +6 -6
  304. data/spec/unit/provider/package/windows_spec.rb +1 -1
  305. data/spec/unit/provider/package/yum_spec.rb +199 -104
  306. data/spec/unit/provider/package/zypper_spec.rb +41 -15
  307. data/spec/unit/provider/service/openbsd_spec.rb +129 -22
  308. data/spec/unit/provider/service/redhat_spec.rb +18 -4
  309. data/spec/unit/provider/service/systemd_spec.rb +5 -9
  310. data/spec/unit/provider/service/upstart_spec.rb +1 -1
  311. data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
  312. data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
  313. data/spec/unit/resource/catalog_spec.rb +20 -104
  314. data/spec/unit/resource/type_collection_spec.rb +10 -9
  315. data/spec/unit/settings/config_file_spec.rb +29 -6
  316. data/spec/unit/settings/environment_conf_spec.rb +51 -0
  317. data/spec/unit/settings_spec.rb +97 -12
  318. data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
  319. data/spec/unit/type/augeas_spec.rb +1 -1
  320. data/spec/unit/type/cron_spec.rb +6 -7
  321. data/spec/unit/type/file/checksum_spec.rb +6 -0
  322. data/spec/unit/type/file/content_spec.rb +277 -207
  323. data/spec/unit/type/file_spec.rb +9 -7
  324. data/spec/unit/type/user_spec.rb +106 -18
  325. data/spec/unit/type/yumrepo_spec.rb +8 -0
  326. data/spec/unit/util/checksums_spec.rb +12 -5
  327. data/spec/unit/util/diff_spec.rb +8 -0
  328. data/spec/unit/util/execution_spec.rb +4 -4
  329. data/spec/unit/util/feature_spec.rb +2 -0
  330. data/spec/unit/util/logging_spec.rb +14 -4
  331. data/spec/unit/util/rdoc/parser_spec.rb +5 -4
  332. data/spec/unit/util/rubygems_spec.rb +14 -0
  333. data/tasks/parallel.rake +2 -2
  334. metadata +154 -21
  335. checksums.yaml +0 -7
  336. data/lib/puppet/module_tool/applications/generator.rb +0 -142
  337. data/lib/puppet/module_tool/skeleton.rb +0 -37
  338. data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
  339. data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
  340. data/lib/puppet/module_tool/tar/solaris.rb +0 -5
  341. data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
  342. data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -87,7 +87,7 @@ describe Puppet::FileServing::Metadata do
87
87
  end
88
88
  end
89
89
 
90
- describe Puppet::FileServing::Metadata do
90
+ describe Puppet::FileServing::Metadata, :uses_checksums => true do
91
91
  include JSONMatchers
92
92
  include PuppetSpec::Files
93
93
 
@@ -120,23 +120,23 @@ describe Puppet::FileServing::Metadata do
120
120
  metadata.mode.should == 0755
121
121
  end
122
122
 
123
- describe "#checksum" do
124
- let(:checksum) { Digest::MD5.hexdigest("some content\n") }
125
-
126
- before :each do
127
- File.open(path, "wb") {|f| f.print("some content\n")}
128
- end
129
-
130
- it "should default to a checksum of type MD5 with the file's current checksum" do
131
- metadata.checksum.should == "{md5}#{checksum}"
132
- end
133
-
134
- it "should give a mtime checksum when checksum_type is set" do
135
- time = Time.now
136
- metadata.checksum_type = "mtime"
137
- metadata.expects(:mtime_file).returns(@time)
138
- metadata.collect
139
- metadata.checksum.should == "{mtime}#{@time}"
123
+ describe "checksumming" do
124
+ with_digest_algorithms do
125
+ before :each do
126
+ File.open(path, "wb") {|f| f.print(plaintext)}
127
+ end
128
+
129
+ it "should default to a checksum of the proper type with the file's current checksum" do
130
+ metadata.checksum.should == "{#{digest_algorithm}}#{checksum}"
131
+ end
132
+
133
+ it "should give a mtime checksum when checksum_type is set" do
134
+ time = Time.now
135
+ metadata.checksum_type = "mtime"
136
+ metadata.expects(:mtime_file).returns(@time)
137
+ metadata.collect
138
+ metadata.checksum.should == "{mtime}#{@time}"
139
+ end
140
140
  end
141
141
  end
142
142
 
@@ -226,11 +226,10 @@ describe Puppet::FileServing::Metadata do
226
226
  # 'path' is a link that points to 'target'
227
227
  let(:path) { tmpfile('file_serving_metadata_link') }
228
228
  let(:target) { tmpfile('file_serving_metadata_target') }
229
- let(:checksum) { Digest::MD5.hexdigest("some content\n") }
230
229
  let(:fmode) { Puppet::FileSystem.lstat(path).mode & 0777 }
231
230
 
232
231
  before :each do
233
- File.open(target, "wb") {|f| f.print("some content\n")}
232
+ File.open(target, "wb") {|f| f.print('some content')}
234
233
  set_mode(0644, target)
235
234
 
236
235
  Puppet::FileSystem.symlink(target, path)
@@ -250,7 +249,7 @@ describe Puppet::FileServing::Metadata do
250
249
  let(:path) { tmpfile('file_serving_metadata_find_file') }
251
250
 
252
251
  before :each do
253
- File.open(path, "wb") {|f| f.print("some content\n")}
252
+ File.open(path, "wb") {|f| f.print('some content')}
254
253
  set_mode(0755, path)
255
254
  end
256
255
 
@@ -369,64 +368,65 @@ describe Puppet::FileServing::Metadata do
369
368
  end
370
369
 
371
370
 
372
- describe Puppet::FileServing::Metadata, " when pointing to a link", :if => Puppet.features.manages_symlinks? do
373
- describe "when links are managed" do
374
- before do
375
- path = "/base/path/my/file"
376
- @file = Puppet::FileServing::Metadata.new(path, :links => :manage)
377
- stat = stub("stat", :uid => 1, :gid => 2, :ftype => "link", :mode => 0755)
378
- stub_file = stub(:readlink => "/some/other/path", :lstat => stat)
379
- Puppet::FileSystem.expects(:lstat).with(path).at_least_once.returns stat
380
- Puppet::FileSystem.expects(:readlink).with(path).at_least_once.returns "/some/other/path"
381
- @checksum = Digest::MD5.hexdigest("some content\n") # Remove these when :managed links are no longer checksumed.
382
- @file.stubs(:md5_file).returns(@checksum) #
383
-
384
- if Puppet.features.microsoft_windows?
385
- win_stat = stub('win_stat', :owner => 'snarf', :group => 'thundercats',
386
- :ftype => 'link', :mode => 0755)
387
- Puppet::FileServing::Metadata::WindowsStat.stubs(:new).returns win_stat
371
+ describe Puppet::FileServing::Metadata, " when pointing to a link", :if => Puppet.features.manages_symlinks?, :uses_checksums => true do
372
+ with_digest_algorithms do
373
+ describe "when links are managed" do
374
+ before do
375
+ path = "/base/path/my/file"
376
+ @file = Puppet::FileServing::Metadata.new(path, :links => :manage)
377
+ stat = stub("stat", :uid => 1, :gid => 2, :ftype => "link", :mode => 0755)
378
+ stub_file = stub(:readlink => "/some/other/path", :lstat => stat)
379
+ Puppet::FileSystem.expects(:lstat).with(path).at_least_once.returns stat
380
+ Puppet::FileSystem.expects(:readlink).with(path).at_least_once.returns "/some/other/path"
381
+ @file.stubs("#{digest_algorithm}_file".intern).returns(checksum) # Remove these when :managed links are no longer checksumed.
382
+
383
+ if Puppet.features.microsoft_windows?
384
+ win_stat = stub('win_stat', :owner => 'snarf', :group => 'thundercats',
385
+ :ftype => 'link', :mode => 0755)
386
+ Puppet::FileServing::Metadata::WindowsStat.stubs(:new).returns win_stat
387
+ end
388
+
388
389
  end
389
- end
390
390
 
391
- it "should store the destination of the link in :destination if links are :manage" do
392
- @file.collect
393
- @file.destination.should == "/some/other/path"
394
- end
395
- pending "should not collect the checksum if links are :manage" do
396
- # We'd like this to be true, but we need to always collect the checksum because in the server/client/server round trip we lose the distintion between manage and follow.
397
- @file.collect
398
- @file.checksum.should be_nil
399
- end
400
- it "should collect the checksum if links are :manage" do # see pending note above
401
- @file.collect
402
- @file.checksum.should == "{md5}#{@checksum}"
391
+ it "should store the destination of the link in :destination if links are :manage" do
392
+ @file.collect
393
+ @file.destination.should == "/some/other/path"
394
+ end
395
+ pending "should not collect the checksum if links are :manage" do
396
+ # We'd like this to be true, but we need to always collect the checksum because in the server/client/server round trip we lose the distintion between manage and follow.
397
+ @file.collect
398
+ @file.checksum.should be_nil
399
+ end
400
+ it "should collect the checksum if links are :manage" do # see pending note above
401
+ @file.collect
402
+ @file.checksum.should == "{#{digest_algorithm}}#{checksum}"
403
+ end
403
404
  end
404
- end
405
405
 
406
- describe "when links are followed" do
407
- before do
408
- path = "/base/path/my/file"
409
- @file = Puppet::FileServing::Metadata.new(path, :links => :follow)
410
- stat = stub("stat", :uid => 1, :gid => 2, :ftype => "file", :mode => 0755)
411
- Puppet::FileSystem.expects(:stat).with(path).at_least_once.returns stat
412
- Puppet::FileSystem.expects(:readlink).never
413
-
414
- if Puppet.features.microsoft_windows?
415
- win_stat = stub('win_stat', :owner => 'snarf', :group => 'thundercats',
416
- :ftype => 'file', :mode => 0755)
417
- Puppet::FileServing::Metadata::WindowsStat.stubs(:new).returns win_stat
418
- end
406
+ describe "when links are followed" do
407
+ before do
408
+ path = "/base/path/my/file"
409
+ @file = Puppet::FileServing::Metadata.new(path, :links => :follow)
410
+ stat = stub("stat", :uid => 1, :gid => 2, :ftype => "file", :mode => 0755)
411
+ Puppet::FileSystem.expects(:stat).with(path).at_least_once.returns stat
412
+ Puppet::FileSystem.expects(:readlink).never
419
413
 
420
- @checksum = Digest::MD5.hexdigest("some content\n")
421
- @file.stubs(:md5_file).returns(@checksum)
422
- end
423
- it "should not store the destination of the link in :destination if links are :follow" do
424
- @file.collect
425
- @file.destination.should be_nil
426
- end
427
- it "should collect the checksum if links are :follow" do
428
- @file.collect
429
- @file.checksum.should == "{md5}#{@checksum}"
414
+ if Puppet.features.microsoft_windows?
415
+ win_stat = stub('win_stat', :owner => 'snarf', :group => 'thundercats',
416
+ :ftype => 'file', :mode => 0755)
417
+ Puppet::FileServing::Metadata::WindowsStat.stubs(:new).returns win_stat
418
+ end
419
+
420
+ @file.stubs("#{digest_algorithm}_file".intern).returns(checksum)
421
+ end
422
+ it "should not store the destination of the link in :destination if links are :follow" do
423
+ @file.collect
424
+ @file.destination.should be_nil
425
+ end
426
+ it "should collect the checksum if links are :follow" do
427
+ @file.collect
428
+ @file.checksum.should == "{#{digest_algorithm}}#{checksum}"
429
+ end
430
430
  end
431
431
  end
432
432
  end
@@ -0,0 +1,131 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+ require 'puppet/forge'
4
+ require 'net/http'
5
+ require 'puppet/module_tool'
6
+
7
+ describe Puppet::Forge::ModuleRelease do
8
+ let(:agent) { "Test/1.0" }
9
+ let(:repository) { Puppet::Forge::Repository.new('http://fake.com', agent) }
10
+ let(:ssl_repository) { Puppet::Forge::Repository.new('https://fake.com', agent) }
11
+
12
+ let(:release_json) do
13
+ <<-EOF
14
+ {
15
+ "uri": "/v3/releases/puppetlabs-stdlib-4.1.0",
16
+ "module": {
17
+ "uri": "/v3/modules/puppetlabs-stdlib",
18
+ "name": "stdlib",
19
+ "owner": {
20
+ "uri": "/v3/users/puppetlabs",
21
+ "username": "puppetlabs",
22
+ "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec"
23
+ }
24
+ },
25
+ "version": "4.1.0",
26
+ "metadata": {
27
+ "types": [ ],
28
+ "license": "Apache 2.0",
29
+ "checksums": { },
30
+ "version": "4.1.0",
31
+ "description": "Standard Library for Puppet Modules",
32
+ "source": "git://github.com/puppetlabs/puppetlabs-stdlib.git",
33
+ "project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
34
+ "summary": "Puppet Module Standard Library",
35
+ "dependencies": [
36
+
37
+ ],
38
+ "author": "puppetlabs",
39
+ "name": "puppetlabs-stdlib"
40
+ },
41
+ "tags": [
42
+ "puppetlabs",
43
+ "library",
44
+ "stdlib",
45
+ "standard",
46
+ "stages"
47
+ ],
48
+ "file_uri": "/v3/files/puppetlabs-stdlib-4.1.0.tar.gz",
49
+ "file_size": 67586,
50
+ "file_md5": "bbf919d7ee9d278d2facf39c25578bf8",
51
+ "downloads": 610751,
52
+ "readme": "",
53
+ "changelog": "",
54
+ "license": "",
55
+ "created_at": "2013-05-13 08:31:19 -0700",
56
+ "updated_at": "2013-05-13 08:31:19 -0700",
57
+ "deleted_at": null
58
+ }
59
+ EOF
60
+ end
61
+
62
+ let(:release) { Puppet::Forge::ModuleRelease.new(ssl_repository, JSON.parse(release_json)) }
63
+
64
+ let(:mock_file) {
65
+ mock_io = StringIO.new
66
+ mock_io.stubs(:path).returns('/dev/null')
67
+ mock_io
68
+ }
69
+
70
+ let(:mock_dir) { '/tmp' }
71
+
72
+ def mock_digest_file_with_md5(md5)
73
+ Digest::MD5.stubs(:file).returns(stub(:hexdigest => md5))
74
+ end
75
+
76
+ describe '#prepare' do
77
+ before :each do
78
+ release.stubs(:tmpfile).returns(mock_file)
79
+ release.stubs(:tmpdir).returns(mock_dir)
80
+ end
81
+
82
+ it 'should call sub methods with correct params' do
83
+ release.expects(:download).with('/v3/files/puppetlabs-stdlib-4.1.0.tar.gz', mock_file)
84
+ release.expects(:validate_checksum).with(mock_file, 'bbf919d7ee9d278d2facf39c25578bf8')
85
+ release.expects(:unpack).with(mock_file, mock_dir)
86
+
87
+ release.prepare
88
+ end
89
+ end
90
+
91
+ describe '#tmpfile' do
92
+
93
+ # This is impossible to test under Ruby 1.8.x, but should also occur there.
94
+ it 'should be opened in binary mode', :unless => RUBY_VERSION >= '1.8.7' do
95
+ Puppet::Forge::Cache.stubs(:base_path).returns(Dir.tmpdir)
96
+ release.send(:tmpfile).binmode?.should be_true
97
+ end
98
+ end
99
+
100
+ describe '#download' do
101
+ it 'should call make_http_request with correct params' do
102
+ # valid URI comes from file_uri in JSON blob above
103
+ ssl_repository.expects(:make_http_request).with('/v3/files/puppetlabs-stdlib-4.1.0.tar.gz', mock_file).returns(mock_file)
104
+
105
+ release.send(:download, '/v3/files/puppetlabs-stdlib-4.1.0.tar.gz', mock_file)
106
+ end
107
+ end
108
+
109
+ describe '#verify_checksum' do
110
+ it 'passes md5 check when valid' do
111
+ # valid hash comes from file_md5 in JSON blob above
112
+ mock_digest_file_with_md5('bbf919d7ee9d278d2facf39c25578bf8')
113
+
114
+ release.send(:validate_checksum, mock_file, 'bbf919d7ee9d278d2facf39c25578bf8')
115
+ end
116
+
117
+ it 'fails md5 check when invalid' do
118
+ mock_digest_file_with_md5('ffffffffffffffffffffffffffffffff')
119
+
120
+ expect { release.send(:validate_checksum, mock_file, 'bbf919d7ee9d278d2facf39c25578bf8') }.to raise_error(RuntimeError, /did not match expected checksum/)
121
+ end
122
+ end
123
+
124
+ describe '#unpack' do
125
+ it 'should call unpacker with correct params' do
126
+ Puppet::ModuleTool::Applications::Unpacker.expects(:unpack).with(mock_file.path, mock_dir).returns(true)
127
+
128
+ release.send(:unpack, mock_file, mock_dir)
129
+ end
130
+ end
131
+ end
@@ -1,12 +1,14 @@
1
1
  # encoding: utf-8
2
2
  require 'spec_helper'
3
3
  require 'net/http'
4
- require 'puppet/forge'
4
+ require 'puppet/forge/repository'
5
+ require 'puppet/forge/cache'
6
+ require 'puppet/forge/errors'
5
7
 
6
8
  describe Puppet::Forge::Repository do
7
- let(:consumer_version) { "Test/1.0" }
8
- let(:repository) { Puppet::Forge::Repository.new('http://fake.com', consumer_version) }
9
- let(:ssl_repository) { Puppet::Forge::Repository.new('https://fake.com', consumer_version) }
9
+ let(:agent) { "Test/1.0" }
10
+ let(:repository) { Puppet::Forge::Repository.new('http://fake.com', agent) }
11
+ let(:ssl_repository) { Puppet::Forge::Repository.new('https://fake.com', agent) }
10
12
 
11
13
  it "retrieve accesses the cache" do
12
14
  path = '/module/foo.tar.gz'
@@ -16,10 +18,12 @@ describe Puppet::Forge::Repository do
16
18
  end
17
19
 
18
20
  it "retrieve merges forge URI and path specified" do
21
+ host = 'http://fake.com/test'
19
22
  path = '/module/foo.tar.gz'
20
- repo_uri = 'http://fake.com/test'
21
- repository = Puppet::Forge::Repository.new(repo_uri, consumer_version)
22
- repository.cache.expects(:retrieve).with(URI.parse(repo_uri+path))
23
+ uri = [ host, path ].join('')
24
+
25
+ repository = Puppet::Forge::Repository.new(host, agent)
26
+ repository.cache.expects(:retrieve).with(uri)
23
27
 
24
28
  repository.retrieve(path)
25
29
  end
@@ -30,7 +34,8 @@ describe Puppet::Forge::Repository do
30
34
  end
31
35
 
32
36
  it "returns the result object from the request" do
33
- result = "the http response"
37
+ result = "#{Object.new}"
38
+
34
39
  performs_an_http_request result do |http|
35
40
  http.expects(:request).with(responds_with(:path, "the_path"))
36
41
  end
@@ -39,7 +44,7 @@ describe Puppet::Forge::Repository do
39
44
  end
40
45
 
41
46
  it 'returns the result object from a request with ssl' do
42
- result = "the http response"
47
+ result = "#{Object.new}"
43
48
  performs_an_https_request result do |http|
44
49
  http.expects(:request).with(responds_with(:path, "the_path"))
45
50
  end
@@ -48,7 +53,7 @@ describe Puppet::Forge::Repository do
48
53
  end
49
54
 
50
55
  it 'return a valid exception when there is an SSL verification problem' do
51
- performs_an_https_request "the http response" do |http|
56
+ performs_an_https_request "#{Object.new}" do |http|
52
57
  http.expects(:request).with(responds_with(:path, "the_path")).raises OpenSSL::SSL::SSLError.new("certificate verify failed")
53
58
  end
54
59
 
@@ -56,7 +61,7 @@ describe Puppet::Forge::Repository do
56
61
  end
57
62
 
58
63
  it 'return a valid exception when there is a communication problem' do
59
- performs_an_http_request "the http response" do |http|
64
+ performs_an_http_request "#{Object.new}" do |http|
60
65
  http.expects(:request).with(responds_with(:path, "the_path")).raises SocketError
61
66
  end
62
67
 
@@ -66,17 +71,13 @@ describe Puppet::Forge::Repository do
66
71
  end
67
72
 
68
73
  it "sets the user agent for the request" do
69
- performs_an_http_request do |http|
70
- http.expects(:request).with() do |request|
71
- puppet_version = /Puppet\/\d+\..*/
72
- os_info = /\(.*\)/
73
- ruby_version = /Ruby\/\d+\.\d+\.\d+(-p-?\d+)? \(\d{4}-\d{2}-\d{2}; .*\)/
74
+ path = 'the_path'
74
75
 
75
- request["User-Agent"] =~ /^#{consumer_version} #{puppet_version} #{os_info} #{ruby_version}/
76
- end
77
- end
76
+ request = repository.get_request_object(path)
78
77
 
79
- repository.make_http_request("the_path")
78
+ request['User-Agent'].should =~ /\b#{agent}\b/
79
+ request['User-Agent'].should =~ /\bPuppet\b/
80
+ request['User-Agent'].should =~ /\bRuby\b/
80
81
  end
81
82
 
82
83
  it "escapes the received URI" do
@@ -4,34 +4,110 @@ require 'net/http'
4
4
  require 'puppet/module_tool'
5
5
 
6
6
  describe Puppet::Forge do
7
- let(:response_body) do
7
+ let(:http_response) do
8
8
  <<-EOF
9
- [
10
- {
11
- "author": "puppetlabs",
12
- "name": "bacula",
13
- "tag_list": ["backup", "bacula"],
14
- "releases": [{"version": "0.0.1"}, {"version": "0.0.2"}],
15
- "full_name": "puppetlabs/bacula",
16
- "version": "0.0.2",
17
- "project_url": "http://github.com/puppetlabs/puppetlabs-bacula",
18
- "desc": "bacula"
19
- }
20
- ]
9
+ {
10
+ "pagination": {
11
+ "limit": 1,
12
+ "offset": 0,
13
+ "first": "/v3/modules?limit=1&offset=0",
14
+ "previous": null,
15
+ "current": "/v3/modules?limit=1&offset=0",
16
+ "next": null,
17
+ "total": 1832
18
+ },
19
+ "results": [
20
+ {
21
+ "uri": "/v3/modules/puppetlabs-bacula",
22
+ "name": "bacula",
23
+ "downloads": 640274,
24
+ "created_at": "2011-05-24 18:34:58 -0700",
25
+ "updated_at": "2013-12-03 15:24:20 -0800",
26
+ "owner": {
27
+ "uri": "/v3/users/puppetlabs",
28
+ "username": "puppetlabs",
29
+ "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec"
30
+ },
31
+ "current_release": {
32
+ "uri": "/v3/releases/puppetlabs-bacula-0.0.2",
33
+ "module": {
34
+ "uri": "/v3/modules/puppetlabs-bacula",
35
+ "name": "bacula",
36
+ "owner": {
37
+ "uri": "/v3/users/puppetlabs",
38
+ "username": "puppetlabs",
39
+ "gravatar_id": "fdd009b7c1ec96e088b389f773e87aec"
40
+ }
41
+ },
42
+ "version": "0.0.2",
43
+ "metadata": {
44
+ "types": [],
45
+ "license": "Apache 2.0",
46
+ "checksums": { },
47
+ "version": "0.0.2",
48
+ "source": "git://github.com/puppetlabs/puppetlabs-bacula.git",
49
+ "project_page": "https://github.com/puppetlabs/puppetlabs-bacula",
50
+ "summary": "bacula",
51
+ "dependencies": [ ],
52
+ "author": "puppetlabs",
53
+ "name": "puppetlabs-bacula"
54
+ },
55
+ "tags": [
56
+ "backup",
57
+ "bacula"
58
+ ],
59
+ "file_uri": "/v3/files/puppetlabs-bacula-0.0.2.tar.gz",
60
+ "file_size": 67586,
61
+ "file_md5": "bbf919d7ee9d278d2facf39c25578bf8",
62
+ "downloads": 565041,
63
+ "readme": "",
64
+ "changelog": "",
65
+ "license": "",
66
+ "created_at": "2013-05-13 08:31:19 -0700",
67
+ "updated_at": "2013-05-13 08:31:19 -0700",
68
+ "deleted_at": null
69
+ },
70
+ "releases": [
71
+ {
72
+ "uri": "/v3/releases/puppetlabs-bacula-0.0.2",
73
+ "version": "0.0.2"
74
+ },
75
+ {
76
+ "uri": "/v3/releases/puppetlabs-bacula-0.0.1",
77
+ "version": "0.0.1"
78
+ }
79
+ ],
80
+ "homepage_url": "https://github.com/puppetlabs/puppetlabs-bacula",
81
+ "issues_url": "https://projects.puppetlabs.com/projects/bacula/issues"
82
+ }
83
+ ]
84
+ }
21
85
  EOF
22
86
  end
23
87
 
24
- let(:forge) { Puppet::Forge.new("test_agent", SemVer.new("v1.0.0")) }
88
+ let(:search_results) do
89
+ JSON.parse(http_response)['results'].map do |hash|
90
+ hash.merge(
91
+ "author" => "puppetlabs",
92
+ "name" => "bacula",
93
+ "tag_list" => ["backup", "bacula"],
94
+ "full_name" => "puppetlabs/bacula",
95
+ "version" => "0.0.2",
96
+ "project_url" => "https://github.com/puppetlabs/puppetlabs-bacula",
97
+ "desc" => "bacula"
98
+ )
99
+ end
100
+ end
101
+
102
+ let(:forge) { Puppet::Forge.new }
25
103
 
26
104
  def repository_responds_with(response)
27
105
  Puppet::Forge::Repository.any_instance.stubs(:make_http_request).returns(response)
28
106
  end
29
107
 
30
108
  it "returns a list of matches from the forge when there are matches for the search term" do
31
- response = stub(:body => response_body, :code => '200')
32
- repository_responds_with(response)
33
-
34
- forge.search('bacula').should == PSON.load(response_body)
109
+ repository_responds_with(stub(:body => http_response, :code => '200'))
110
+ forge.search('bacula').should == search_results
35
111
  end
36
112
 
37
113
  context "when the connection to the forge fails" do
@@ -43,18 +119,18 @@ describe Puppet::Forge do
43
119
  expect { forge.search('bacula') }.to raise_error Puppet::Forge::Errors::ResponseError, "Could not execute operation for 'bacula'. Detail: 404 not found."
44
120
  end
45
121
 
46
- it "raises an error for remote_dependency_info" do
47
- expect { forge.remote_dependency_info('puppetlabs', 'bacula', '0.0.1') }.to raise_error Puppet::Forge::Errors::ResponseError, "Could not execute operation for 'puppetlabs/bacula'. Detail: 404 not found."
122
+ it "raises an error for fetch" do
123
+ expect { forge.fetch('puppetlabs/bacula') }.to raise_error Puppet::Forge::Errors::ResponseError, "Could not execute operation for 'puppetlabs/bacula'. Detail: 404 not found."
48
124
  end
49
125
  end
50
126
 
51
- context "when the API responses with an error" do
127
+ context "when the API responds with an error" do
52
128
  before :each do
53
129
  repository_responds_with(stub(:body => '{"error":"invalid module"}', :code => '410', :message => "Gone"))
54
130
  end
55
131
 
56
- it "raises an error for remote_dependency_info" do
57
- expect { forge.remote_dependency_info('puppetlabs', 'bacula', '0.0.1') }.to raise_error Puppet::Forge::Errors::ResponseError, "Could not execute operation for 'puppetlabs/bacula'. Detail: invalid module / 410 Gone."
132
+ it "raises an error for fetch" do
133
+ expect { forge.fetch('puppetlabs/bacula') }.to raise_error Puppet::Forge::Errors::ResponseError, "Could not execute operation for 'puppetlabs/bacula'. Detail: 410 Gone."
58
134
  end
59
135
  end
60
136
  end