vagrant-unbundled 1.8.4.2 → 1.8.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (281) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +52 -0
  4. data/Gemfile.lock +9 -7
  5. data/RELEASE.md +37 -14
  6. data/lib/vagrant/action/builtin/box_add.rb +3 -1
  7. data/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +5 -0
  8. data/lib/vagrant/box_collection.rb +2 -1
  9. data/lib/vagrant/bundler.rb +36 -1
  10. data/lib/vagrant/errors.rb +16 -8
  11. data/lib/vagrant/plugin/state_file.rb +8 -1
  12. data/lib/vagrant/util/platform.rb +1 -1
  13. data/plugins/guests/arch/cap/change_host_name.rb +13 -10
  14. data/plugins/guests/arch/cap/configure_networks.rb +11 -8
  15. data/plugins/guests/arch/cap/nfs.rb +35 -0
  16. data/plugins/guests/arch/cap/rsync.rb +16 -0
  17. data/plugins/guests/arch/cap/smb.rb +17 -0
  18. data/plugins/guests/arch/plugin.rb +28 -3
  19. data/plugins/guests/atomic/cap/change_host_name.rb +13 -10
  20. data/plugins/guests/atomic/plugin.rb +3 -3
  21. data/plugins/guests/{netbsd → bsd}/cap/halt.rb +2 -2
  22. data/plugins/guests/bsd/cap/nfs.rb +49 -0
  23. data/plugins/guests/bsd/cap/public_key.rb +65 -0
  24. data/plugins/guests/bsd/cap/virtualbox.rb +16 -0
  25. data/plugins/guests/bsd/guest.rb +9 -0
  26. data/plugins/guests/bsd/plugin.rb +40 -0
  27. data/plugins/guests/coreos/cap/change_host_name.rb +1 -1
  28. data/plugins/guests/coreos/plugin.rb +4 -4
  29. data/plugins/guests/darwin/cap/change_host_name.rb +4 -1
  30. data/plugins/guests/darwin/cap/configure_networks.rb +12 -5
  31. data/plugins/guests/darwin/cap/halt.rb +3 -1
  32. data/plugins/guests/darwin/cap/rsync.rb +7 -4
  33. data/plugins/guests/darwin/plugin.rb +13 -28
  34. data/plugins/guests/debian/cap/change_host_name.rb +14 -15
  35. data/plugins/guests/debian/cap/configure_networks.rb +2 -6
  36. data/plugins/guests/debian/cap/{nfs_client.rb → nfs.rb} +2 -1
  37. data/plugins/guests/debian/cap/rsync.rb +5 -6
  38. data/plugins/guests/debian/plugin.rb +8 -8
  39. data/plugins/guests/esxi/cap/mount_nfs_folder.rb +2 -2
  40. data/plugins/guests/esxi/plugin.rb +6 -6
  41. data/plugins/guests/fedora/cap/flavor.rb +1 -1
  42. data/plugins/guests/fedora/plugin.rb +2 -17
  43. data/plugins/guests/freebsd/cap/change_host_name.rb +2 -3
  44. data/plugins/guests/freebsd/cap/rsync.rb +7 -4
  45. data/plugins/guests/freebsd/plugin.rb +9 -29
  46. data/plugins/guests/funtoo/plugin.rb +3 -8
  47. data/plugins/guests/gentoo/cap/change_host_name.rb +21 -6
  48. data/plugins/guests/gentoo/cap/configure_networks.rb +35 -26
  49. data/plugins/guests/gentoo/plugin.rb +4 -4
  50. data/plugins/guests/linux/cap/choose_addressable_ip_addr.rb +2 -3
  51. data/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb +31 -45
  52. data/plugins/guests/linux/cap/network_interfaces.rb +20 -0
  53. data/plugins/guests/linux/cap/nfs.rb +57 -0
  54. data/plugins/guests/linux/cap/public_key.rb +65 -0
  55. data/plugins/guests/linux/cap/rsync.rb +7 -4
  56. data/plugins/guests/linux/plugin.rb +30 -25
  57. data/plugins/guests/mint/plugin.rb +1 -1
  58. data/plugins/guests/netbsd/plugin.rb +10 -30
  59. data/plugins/guests/nixos/plugin.rb +5 -5
  60. data/plugins/guests/omnios/cap/change_host_name.rb +1 -1
  61. data/plugins/guests/omnios/plugin.rb +4 -4
  62. data/plugins/guests/openbsd/cap/change_host_name.rb +21 -3
  63. data/plugins/guests/openbsd/plugin.rb +10 -30
  64. data/plugins/guests/photon/cap/change_host_name.rb +1 -1
  65. data/plugins/guests/photon/plugin.rb +4 -4
  66. data/plugins/guests/pld/cap/change_host_name.rb +1 -1
  67. data/plugins/guests/pld/plugin.rb +4 -4
  68. data/plugins/guests/redhat/cap/change_host_name.rb +4 -3
  69. data/plugins/guests/redhat/cap/configure_networks.rb +1 -24
  70. data/plugins/guests/redhat/plugin.rb +7 -7
  71. data/plugins/guests/slackware/cap/change_host_name.rb +1 -1
  72. data/plugins/guests/slackware/cap/configure_networks.rb +1 -5
  73. data/plugins/guests/slackware/plugin.rb +3 -3
  74. data/plugins/guests/smartos/plugin.rb +12 -12
  75. data/plugins/guests/solaris/plugin.rb +14 -14
  76. data/plugins/guests/solaris11/plugin.rb +12 -12
  77. data/plugins/guests/suse/cap/change_host_name.rb +1 -1
  78. data/plugins/guests/suse/cap/configure_networks.rb +1 -5
  79. data/plugins/guests/suse/plugin.rb +8 -8
  80. data/plugins/guests/tinycore/cap/mount_nfs.rb +2 -2
  81. data/plugins/guests/tinycore/plugin.rb +7 -7
  82. data/plugins/guests/trisquel/plugin.rb +1 -1
  83. data/plugins/guests/ubuntu/guest.rb +1 -1
  84. data/plugins/guests/ubuntu/plugin.rb +1 -6
  85. data/plugins/guests/windows/plugin.rb +2 -2
  86. data/plugins/kernel_v2/config/vm.rb +8 -1
  87. data/plugins/providers/hyperv/scripts/get_vm_status.ps1 +25 -5
  88. data/plugins/providers/virtualbox/driver/meta.rb +1 -0
  89. data/plugins/providers/virtualbox/driver/version_5_1.rb +734 -0
  90. data/plugins/providers/virtualbox/plugin.rb +1 -0
  91. data/plugins/synced_folders/nfs/synced_folder.rb +10 -2
  92. data/plugins/synced_folders/rsync/helper.rb +11 -4
  93. data/scripts/{bintray_upload.sh → sign.sh} +0 -0
  94. data/templates/guests/arch/network_static.erb +3 -3
  95. data/templates/guests/arch/network_static6.erb +8 -0
  96. data/templates/guests/freebsd/network_static6.erb +6 -0
  97. data/templates/guests/funtoo/network_static6.erb +9 -0
  98. data/templates/guests/gentoo/network_dhcp.erb +1 -1
  99. data/templates/guests/gentoo/network_static.erb +4 -4
  100. data/templates/guests/gentoo/network_static6.erb +7 -0
  101. data/templates/guests/redhat/network_dhcp.erb +1 -1
  102. data/templates/guests/redhat/network_static.erb +4 -1
  103. data/templates/guests/{fedora → redhat}/network_static6.erb +5 -2
  104. data/templates/locales/en.yml +40 -6
  105. data/test/unit/plugins/guests/arch/cap/change_host_name_test.rb +6 -6
  106. data/test/unit/plugins/guests/arch/cap/configure_networks_test.rb +20 -15
  107. data/test/unit/plugins/guests/arch/cap/rsync_test.rb +30 -0
  108. data/test/unit/plugins/guests/arch/cap/smb_test.rb +38 -0
  109. data/test/unit/plugins/guests/atomic/cap/change_host_name_test.rb +9 -8
  110. data/test/unit/plugins/guests/{freebsd → bsd}/cap/halt_test.rb +11 -10
  111. data/test/unit/plugins/guests/{freebsd → bsd}/cap/insert_public_key_test.rb +7 -6
  112. data/test/unit/plugins/guests/bsd/cap/nfs_test.rb +68 -0
  113. data/test/unit/plugins/guests/coreos/cap/change_host_name_test.rb +5 -5
  114. data/test/unit/plugins/guests/darwin/cap/change_host_name_test.rb +5 -5
  115. data/test/unit/plugins/guests/darwin/cap/halt_test.rb +36 -0
  116. data/test/unit/plugins/guests/debian/cap/change_host_name_test.rb +3 -5
  117. data/test/unit/plugins/guests/debian/cap/configure_networks_test.rb +13 -9
  118. data/test/unit/plugins/guests/debian/cap/rsync_test.rb +3 -11
  119. data/test/unit/plugins/guests/freebsd/cap/change_host_name_test.rb +2 -2
  120. data/test/unit/plugins/guests/linux/cap/mount_nfs_test.rb +16 -3
  121. data/test/unit/plugins/guests/omnios/cap/change_host_name_test.rb +2 -2
  122. data/test/unit/plugins/guests/photon/cap/change_host_name_test.rb +2 -2
  123. data/test/unit/plugins/guests/pld/cap/change_host_name_test.rb +2 -2
  124. data/test/unit/plugins/guests/redhat/cap/change_host_name_test.rb +4 -3
  125. data/test/unit/plugins/guests/redhat/cap/configure_networks_test.rb +17 -33
  126. data/test/unit/plugins/guests/slackware/cap/change_host_name_test.rb +2 -2
  127. data/test/unit/plugins/guests/slackware/cap/configure_networks_test.rb +8 -4
  128. data/test/unit/plugins/guests/suse/cap/change_host_name_test.rb +2 -2
  129. data/test/unit/plugins/guests/suse/cap/configure_networks_test.rb +13 -16
  130. data/test/unit/plugins/kernel_v2/config/vm_test.rb +10 -2
  131. data/test/unit/templates/guests/arch/network_static_test.rb +4 -2
  132. data/test/unit/templates/guests/gentoo/network_dhcp_test.rb +2 -2
  133. data/test/unit/templates/guests/gentoo/network_static_test.rb +10 -10
  134. data/test/unit/templates/guests/redhat/network_dhcp_test.rb +2 -2
  135. data/test/unit/templates/guests/redhat/network_static_test.rb +9 -9
  136. data/vagrant.gemspec +3 -3
  137. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/CHANGELOG.md +1 -0
  138. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/CONTRIBUTING.md +38 -0
  139. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/LICENSE.txt +22 -0
  140. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/README.md +297 -0
  141. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/bin/listen +12 -0
  142. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/base.rb +141 -0
  143. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/bsd.rb +106 -0
  144. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/config.rb +26 -0
  145. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/darwin.rb +92 -0
  146. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/linux.rb +106 -0
  147. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/polling.rb +37 -0
  148. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter/windows.rb +98 -0
  149. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/adapter.rb +45 -0
  150. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/backend.rb +38 -0
  151. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/change.rb +76 -0
  152. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/cli.rb +65 -0
  153. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/directory.rb +87 -0
  154. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/config.rb +55 -0
  155. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/loop.rb +117 -0
  156. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/processor.rb +122 -0
  157. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/event/queue.rb +55 -0
  158. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/file.rb +80 -0
  159. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/fsm.rb +132 -0
  160. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/internals/thread_pool.rb +29 -0
  161. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/listener/config.rb +41 -0
  162. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/listener.rb +133 -0
  163. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/logger.rb +32 -0
  164. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/options.rb +23 -0
  165. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/queue_optimizer.rb +132 -0
  166. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/record/entry.rb +64 -0
  167. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/record/symlink_detector.rb +39 -0
  168. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/record.rb +118 -0
  169. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/silencer/controller.rb +48 -0
  170. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/silencer.rb +97 -0
  171. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen/version.rb +3 -0
  172. data/vendor/bundle/ruby/2.3.0/gems/listen-3.1.5/lib/listen.rb +57 -0
  173. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/.gitignore +8 -0
  174. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/.rspec +2 -0
  175. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/.rubocop-disables.yml +384 -0
  176. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/.rubocop.yml +3 -0
  177. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/.travis.yml +43 -0
  178. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/AUTHORS +98 -0
  179. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/Gemfile +11 -0
  180. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/LICENSE +21 -0
  181. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/README.md +667 -0
  182. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/Rakefile +132 -0
  183. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/bin/restclient +92 -0
  184. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/history.md +310 -0
  185. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/rest-client.rb +2 -0
  186. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/rest_client.rb +2 -0
  187. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/abstract_response.rb +226 -0
  188. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/exceptions.rb +244 -0
  189. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/params_array.rb +72 -0
  190. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/payload.rb +209 -0
  191. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/platform.rb +49 -0
  192. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/raw_response.rb +38 -0
  193. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/request.rb +904 -0
  194. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/resource.rb +168 -0
  195. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/response.rb +80 -0
  196. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/utils.rb +235 -0
  197. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/version.rb +8 -0
  198. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/windows/root_certs.rb +105 -0
  199. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient/windows.rb +8 -0
  200. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/lib/restclient.rb +184 -0
  201. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/rest-client.gemspec +31 -0
  202. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/rest-client.windows.gemspec +19 -0
  203. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/helpers.rb +22 -0
  204. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/_lib.rb +1 -0
  205. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_digicert/244b5494.0 +19 -0
  206. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_digicert/81b9768f.0 +19 -0
  207. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_digicert/README +8 -0
  208. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_digicert/digicert.crt +19 -0
  209. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_verisign/415660c1.0 +14 -0
  210. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_verisign/7651b327.0 +14 -0
  211. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_verisign/README +8 -0
  212. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/capath_verisign/verisign.crt +14 -0
  213. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/certs/digicert.crt +19 -0
  214. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/certs/verisign.crt +14 -0
  215. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/httpbin_spec.rb +86 -0
  216. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/integration_spec.rb +125 -0
  217. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/integration/request_spec.rb +127 -0
  218. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/spec_helper.rb +29 -0
  219. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/_lib.rb +1 -0
  220. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/abstract_response_spec.rb +145 -0
  221. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/exceptions_spec.rb +108 -0
  222. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/master_shake.jpg +0 -0
  223. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/params_array_spec.rb +36 -0
  224. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/payload_spec.rb +263 -0
  225. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/raw_response_spec.rb +18 -0
  226. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/request2_spec.rb +54 -0
  227. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/request_spec.rb +1265 -0
  228. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/resource_spec.rb +130 -0
  229. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/response_spec.rb +241 -0
  230. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/restclient_spec.rb +79 -0
  231. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/utils_spec.rb +147 -0
  232. data/vendor/bundle/ruby/2.3.0/gems/rest-client-2.0.0/spec/unit/windows/root_certs_spec.rb +22 -0
  233. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/.gitignore +10 -0
  234. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/.rspec +3 -0
  235. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/.rubocop.yml +3 -0
  236. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/.travis.yml +11 -0
  237. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/LICENSE.txt +21 -0
  238. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/README.md +151 -0
  239. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/logger.rb +16 -0
  240. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/quiet.rb +3 -0
  241. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/ruby_version.rb +58 -0
  242. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/travis/ruby_version.rb +59 -0
  243. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/travis.rb +58 -0
  244. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/version.rb +3 -0
  245. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep/warning.rb +97 -0
  246. data/vendor/bundle/ruby/2.3.0/gems/ruby_dep-1.4.0/lib/ruby_dep.rb +2 -0
  247. data/vendor/bundle/ruby/2.3.0/specifications/listen-3.1.5.gemspec +44 -0
  248. data/vendor/bundle/ruby/2.3.0/specifications/rest-client-2.0.0.gemspec +60 -0
  249. data/vendor/bundle/ruby/2.3.0/specifications/ruby_dep-1.4.0.gemspec +34 -0
  250. data/version.txt +1 -1
  251. metadata +147 -44
  252. data/plugins/guests/darwin/cap/insert_public_key.rb +0 -33
  253. data/plugins/guests/darwin/cap/mount_nfs_folder.rb +0 -37
  254. data/plugins/guests/darwin/cap/remove_public_key.rb +0 -21
  255. data/plugins/guests/fedora/cap/change_host_name.rb +0 -29
  256. data/plugins/guests/fedora/cap/configure_networks.rb +0 -135
  257. data/plugins/guests/fedora/cap/network_scripts_dir.rb +0 -15
  258. data/plugins/guests/freebsd/cap/halt.rb +0 -16
  259. data/plugins/guests/freebsd/cap/insert_public_key.rb +0 -34
  260. data/plugins/guests/freebsd/cap/mount_nfs_folder.rb +0 -24
  261. data/plugins/guests/freebsd/cap/remove_public_key.rb +0 -21
  262. data/plugins/guests/funtoo/cap/change_host_name.rb +0 -17
  263. data/plugins/guests/linux/cap/insert_public_key.rb +0 -31
  264. data/plugins/guests/linux/cap/mount_nfs.rb +0 -50
  265. data/plugins/guests/linux/cap/nfs_client.rb +0 -11
  266. data/plugins/guests/linux/cap/remove_public_key.rb +0 -24
  267. data/plugins/guests/netbsd/cap/insert_public_key.rb +0 -21
  268. data/plugins/guests/netbsd/cap/mount_nfs_folder.rb +0 -17
  269. data/plugins/guests/netbsd/cap/remove_public_key.rb +0 -21
  270. data/plugins/guests/openbsd/cap/halt.rb +0 -16
  271. data/plugins/guests/openbsd/cap/insert_public_key.rb +0 -21
  272. data/plugins/guests/openbsd/cap/mount_nfs_folder.rb +0 -14
  273. data/plugins/guests/openbsd/cap/remove_public_key.rb +0 -21
  274. data/plugins/guests/ubuntu/cap/change_host_name.rb +0 -52
  275. data/templates/guests/fedora/network_dhcp.erb +0 -6
  276. data/templates/guests/fedora/network_static.erb +0 -16
  277. data/test/unit/plugins/guests/freebsd/cap/mount_nfs_folder_test.rb +0 -53
  278. data/test/unit/plugins/guests/ubuntu/cap/change_host_name_test.rb +0 -42
  279. data/test/unit/templates/guests/fedora/network_dhcp_test.rb +0 -21
  280. data/test/unit/templates/guests/fedora/network_static6_test.rb +0 -25
  281. data/test/unit/templates/guests/fedora/network_static_test.rb +0 -71
@@ -0,0 +1,130 @@
1
+ require_relative '_lib'
2
+
3
+ describe RestClient::Resource do
4
+ before do
5
+ @resource = RestClient::Resource.new('http://some/resource', :user => 'jane', :password => 'mypass', :headers => {'X-Something' => '1'})
6
+ end
7
+
8
+ context "Resource delegation" do
9
+ it "GET" do
10
+ expect(RestClient::Request).to receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
11
+ @resource.get
12
+ end
13
+
14
+ it "HEAD" do
15
+ expect(RestClient::Request).to receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
16
+ @resource.head
17
+ end
18
+
19
+ it "POST" do
20
+ expect(RestClient::Request).to receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'abc', :headers => {:content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
21
+ @resource.post 'abc', :content_type => 'image/jpg'
22
+ end
23
+
24
+ it "PUT" do
25
+ expect(RestClient::Request).to receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'abc', :headers => {:content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
26
+ @resource.put 'abc', :content_type => 'image/jpg'
27
+ end
28
+
29
+ it "PATCH" do
30
+ expect(RestClient::Request).to receive(:execute).with(:method => :patch, :url => 'http://some/resource', :payload => 'abc', :headers => {:content_type => 'image/jpg', 'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
31
+ @resource.patch 'abc', :content_type => 'image/jpg'
32
+ end
33
+
34
+ it "DELETE" do
35
+ expect(RestClient::Request).to receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => {'X-Something' => '1'}, :user => 'jane', :password => 'mypass')
36
+ @resource.delete
37
+ end
38
+
39
+ it "overrides resource headers" do
40
+ expect(RestClient::Request).to receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {'X-Something' => '2'}, :user => 'jane', :password => 'mypass')
41
+ @resource.get 'X-Something' => '2'
42
+ end
43
+ end
44
+
45
+ it "can instantiate with no user/password" do
46
+ @resource = RestClient::Resource.new('http://some/resource')
47
+ end
48
+
49
+ it "is backwards compatible with previous constructor" do
50
+ @resource = RestClient::Resource.new('http://some/resource', 'user', 'pass')
51
+ expect(@resource.user).to eq 'user'
52
+ expect(@resource.password).to eq 'pass'
53
+ end
54
+
55
+ it "concatenates urls, inserting a slash when it needs one" do
56
+ expect(@resource.concat_urls('http://example.com', 'resource')).to eq 'http://example.com/resource'
57
+ end
58
+
59
+ it "concatenates urls, using no slash if the first url ends with a slash" do
60
+ expect(@resource.concat_urls('http://example.com/', 'resource')).to eq 'http://example.com/resource'
61
+ end
62
+
63
+ it "concatenates urls, using no slash if the second url starts with a slash" do
64
+ expect(@resource.concat_urls('http://example.com', '/resource')).to eq 'http://example.com/resource'
65
+ end
66
+
67
+ it "concatenates even non-string urls, :posts + 1 => 'posts/1'" do
68
+ expect(@resource.concat_urls(:posts, 1)).to eq 'posts/1'
69
+ end
70
+
71
+ it "offers subresources via []" do
72
+ parent = RestClient::Resource.new('http://example.com')
73
+ expect(parent['posts'].url).to eq 'http://example.com/posts'
74
+ end
75
+
76
+ it "transports options to subresources" do
77
+ parent = RestClient::Resource.new('http://example.com', :user => 'user', :password => 'password')
78
+ expect(parent['posts'].user).to eq 'user'
79
+ expect(parent['posts'].password).to eq 'password'
80
+ end
81
+
82
+ it "passes a given block to subresources" do
83
+ block = proc {|r| r}
84
+ parent = RestClient::Resource.new('http://example.com', &block)
85
+ expect(parent['posts'].block).to eq block
86
+ end
87
+
88
+ it "the block should be overrideable" do
89
+ block1 = proc {|r| r}
90
+ block2 = proc {|r| }
91
+ parent = RestClient::Resource.new('http://example.com', &block1)
92
+ # parent['posts', &block2].block.should eq block2 # ruby 1.9 syntax
93
+ expect(parent.send(:[], 'posts', &block2).block).to eq block2
94
+ expect(parent.send(:[], 'posts', &block2).block).not_to eq block1
95
+ end
96
+
97
+ it "the block should be overrideable in ruby 1.9 syntax" do
98
+ block1 = proc {|r| r}
99
+ block2 = ->(r) {}
100
+
101
+ parent = RestClient::Resource.new('http://example.com', &block1)
102
+ expect(parent['posts', &block2].block).to eq block2
103
+ expect(parent['posts', &block2].block).not_to eq block1
104
+ end
105
+
106
+ it "prints its url with to_s" do
107
+ expect(RestClient::Resource.new('x').to_s).to eq 'x'
108
+ end
109
+
110
+ describe 'block' do
111
+ it 'can use block when creating the resource' do
112
+ stub_request(:get, 'www.example.com').to_return(:body => '', :status => 404)
113
+ resource = RestClient::Resource.new('www.example.com') { |response, request| 'foo' }
114
+ expect(resource.get).to eq 'foo'
115
+ end
116
+
117
+ it 'can use block when executing the resource' do
118
+ stub_request(:get, 'www.example.com').to_return(:body => '', :status => 404)
119
+ resource = RestClient::Resource.new('www.example.com')
120
+ expect(resource.get { |response, request| 'foo' }).to eq 'foo'
121
+ end
122
+
123
+ it 'execution block override resource block' do
124
+ stub_request(:get, 'www.example.com').to_return(:body => '', :status => 404)
125
+ resource = RestClient::Resource.new('www.example.com') { |response, request| 'foo' }
126
+ expect(resource.get { |response, request| 'bar' }).to eq 'bar'
127
+ end
128
+
129
+ end
130
+ end
@@ -0,0 +1,241 @@
1
+ require_relative '_lib'
2
+
3
+ describe RestClient::Response, :include_helpers do
4
+ before do
5
+ @net_http_res = double('net http response', :to_hash => {"Status" => ["200 OK"]}, :code => 200)
6
+ @example_url = 'http://example.com'
7
+ @request = request_double(url: @example_url, method: 'get')
8
+ @response = RestClient::Response.create('abc', @net_http_res, @request)
9
+ end
10
+
11
+ it "behaves like string" do
12
+ expect(@response.to_s).to eq 'abc'
13
+ expect(@response.to_str).to eq 'abc'
14
+
15
+ expect(@response).to receive(:warn)
16
+ expect(@response.to_i).to eq 0
17
+ end
18
+
19
+ it "accepts nil strings and sets it to empty for the case of HEAD" do
20
+ expect(RestClient::Response.create(nil, @net_http_res, @request).to_s).to eq ""
21
+ end
22
+
23
+ describe 'header processing' do
24
+ it "test headers and raw headers" do
25
+ expect(@response.raw_headers["Status"][0]).to eq "200 OK"
26
+ expect(@response.headers[:status]).to eq "200 OK"
27
+ end
28
+
29
+ it 'handles multiple headers by joining with comma' do
30
+ @net_http_res = double('net http response', :to_hash => {'My-Header' => ['foo', 'bar']}, :code => 200)
31
+ @example_url = 'http://example.com'
32
+ @request = request_double(url: @example_url, method: 'get')
33
+ @response = RestClient::Response.create('abc', @net_http_res, @request)
34
+
35
+ expect(@response.raw_headers['My-Header']).to eq ['foo', 'bar']
36
+ expect(@response.headers[:my_header]).to eq 'foo, bar'
37
+ end
38
+ end
39
+
40
+ describe "cookie processing" do
41
+ it "should correctly deal with one Set-Cookie header with one cookie inside" do
42
+ header_val = "main_page=main_page_no_rewrite; path=/; expires=Sat, 10-Jan-2037 15:03:14 GMT".freeze
43
+
44
+ net_http_res = double('net http response', :to_hash => {"etag" => ["\"e1ac1a2df945942ef4cac8116366baad\""], "set-cookie" => [header_val]})
45
+ response = RestClient::Response.create('abc', net_http_res, @request)
46
+ expect(response.headers[:set_cookie]).to eq [header_val]
47
+ expect(response.cookies).to eq({ "main_page" => "main_page_no_rewrite" })
48
+ end
49
+
50
+ it "should correctly deal with multiple cookies [multiple Set-Cookie headers]" do
51
+ net_http_res = double('net http response', :to_hash => {"etag" => ["\"e1ac1a2df945942ef4cac8116366baad\""], "set-cookie" => ["main_page=main_page_no_rewrite; path=/; expires=Sat, 10-Jan-2037 15:03:14 GMT", "remember_me=; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT", "user=somebody; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT"]})
52
+ response = RestClient::Response.create('abc', net_http_res, @request)
53
+ expect(response.headers[:set_cookie]).to eq ["main_page=main_page_no_rewrite; path=/; expires=Sat, 10-Jan-2037 15:03:14 GMT", "remember_me=; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT", "user=somebody; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT"]
54
+ expect(response.cookies).to eq({
55
+ "main_page" => "main_page_no_rewrite",
56
+ "remember_me" => "",
57
+ "user" => "somebody"
58
+ })
59
+ end
60
+
61
+ it "should correctly deal with multiple cookies [one Set-Cookie header with multiple cookies]" do
62
+ net_http_res = double('net http response', :to_hash => {"etag" => ["\"e1ac1a2df945942ef4cac8116366baad\""], "set-cookie" => ["main_page=main_page_no_rewrite; path=/; expires=Sat, 10-Jan-2037 15:03:14 GMT, remember_me=; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT, user=somebody; path=/; expires=Sat, 10-Jan-2037 00:00:00 GMT"]})
63
+ response = RestClient::Response.create('abc', net_http_res, @request)
64
+ expect(response.cookies).to eq({
65
+ "main_page" => "main_page_no_rewrite",
66
+ "remember_me" => "",
67
+ "user" => "somebody"
68
+ })
69
+ end
70
+ end
71
+
72
+ describe "exceptions processing" do
73
+ it "should return itself for normal codes" do
74
+ (200..206).each do |code|
75
+ net_http_res = response_double(:code => '200')
76
+ resp = RestClient::Response.create('abc', net_http_res, @request)
77
+ resp.return!
78
+ end
79
+ end
80
+
81
+ it "should throw an exception for other codes" do
82
+ RestClient::Exceptions::EXCEPTIONS_MAP.each_pair do |code, exc|
83
+ unless (200..207).include? code
84
+ net_http_res = response_double(:code => code.to_i)
85
+ resp = RestClient::Response.create('abc', net_http_res, @request)
86
+ allow(@request).to receive(:max_redirects).and_return(5)
87
+ expect { resp.return! }.to raise_error(exc)
88
+ end
89
+ end
90
+ end
91
+
92
+ end
93
+
94
+ describe "redirection" do
95
+
96
+ it "follows a redirection when the request is a get" do
97
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
98
+ stub_request(:get, 'http://new/resource').to_return(:body => 'Foo')
99
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body).to eq 'Foo'
100
+ end
101
+
102
+ it "keeps redirection history" do
103
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
104
+ stub_request(:get, 'http://new/resource').to_return(:body => 'Foo')
105
+ r = RestClient::Request.execute(url: 'http://some/resource', method: :get)
106
+ expect(r.body).to eq 'Foo'
107
+ expect(r.history.length).to eq 1
108
+ expect(r.history.fetch(0)).to be_a(RestClient::Response)
109
+ expect(r.history.fetch(0).code).to be 301
110
+ end
111
+
112
+ it "follows a redirection and keep the parameters" do
113
+ stub_request(:get, 'http://some/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
114
+ stub_request(:get, 'http://new/resource').with(:headers => {'Accept' => 'application/json'}, :basic_auth => ['foo', 'bar']).to_return(:body => 'Foo')
115
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get, :user => 'foo', :password => 'bar', :headers => {:accept => :json}).body).to eq 'Foo'
116
+ end
117
+
118
+ it "follows a redirection and keep the cookies" do
119
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Set-Cookie' => 'Foo=Bar', 'Location' => 'http://some/new_resource', })
120
+ stub_request(:get, 'http://some/new_resource').with(:headers => {'Cookie' => 'Foo=Bar'}).to_return(:body => 'Qux')
121
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body).to eq 'Qux'
122
+ end
123
+
124
+ it 'respects cookie domains on redirect' do
125
+ stub_request(:get, 'http://some.example.com/').to_return(:body => '', :status => 301,
126
+ :headers => {'Set-Cookie' => 'Foo=Bar', 'Location' => 'http://new.example.com/', })
127
+ stub_request(:get, 'http://new.example.com/').with(
128
+ :headers => {'Cookie' => 'passedthrough=1'}).to_return(:body => 'Qux')
129
+
130
+ expect(RestClient::Request.execute(:url => 'http://some.example.com/', :method => :get, cookies: [HTTP::Cookie.new('passedthrough', '1', domain: 'new.example.com', path: '/')]).body).to eq 'Qux'
131
+ end
132
+
133
+ it "doesn't follow a 301 when the request is a post" do
134
+ net_http_res = response_double(:code => 301)
135
+
136
+ response = RestClient::Response.create('abc', net_http_res,
137
+ request_double(method: 'post'))
138
+ expect {
139
+ response.return!
140
+ }.to raise_error(RestClient::MovedPermanently)
141
+ end
142
+
143
+ it "doesn't follow a 302 when the request is a post" do
144
+ net_http_res = response_double(:code => 302)
145
+ response = RestClient::Response.create('abc', net_http_res,
146
+ request_double(method: 'post'))
147
+ expect {
148
+ response.return!
149
+ }.to raise_error(RestClient::Found)
150
+ end
151
+
152
+ it "doesn't follow a 307 when the request is a post" do
153
+ net_http_res = response_double(:code => 307)
154
+ response = RestClient::Response.create('abc', net_http_res,
155
+ request_double(method: 'post'))
156
+ expect(response).not_to receive(:follow_redirection)
157
+ expect {
158
+ response.return!
159
+ }.to raise_error(RestClient::TemporaryRedirect)
160
+ end
161
+
162
+ it "doesn't follow a redirection when the request is a put" do
163
+ net_http_res = response_double(:code => 301)
164
+ response = RestClient::Response.create('abc', net_http_res,
165
+ request_double(method: 'put'))
166
+ expect {
167
+ response.return!
168
+ }.to raise_error(RestClient::MovedPermanently)
169
+ end
170
+
171
+ it "follows a redirection when the request is a post and result is a 303" do
172
+ stub_request(:put, 'http://some/resource').to_return(:body => '', :status => 303, :headers => {'Location' => 'http://new/resource'})
173
+ stub_request(:get, 'http://new/resource').to_return(:body => 'Foo')
174
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :put).body).to eq 'Foo'
175
+ end
176
+
177
+ it "follows a redirection when the request is a head" do
178
+ stub_request(:head, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
179
+ stub_request(:head, 'http://new/resource').to_return(:body => 'Foo')
180
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :head).body).to eq 'Foo'
181
+ end
182
+
183
+ it "handles redirects with relative paths" do
184
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'index'})
185
+ stub_request(:get, 'http://some/index').to_return(:body => 'Foo')
186
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body).to eq 'Foo'
187
+ end
188
+
189
+ it "handles redirects with relative path and query string" do
190
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'index?q=1'})
191
+ stub_request(:get, 'http://some/index?q=1').to_return(:body => 'Foo')
192
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body).to eq 'Foo'
193
+ end
194
+
195
+ it "follow a redirection when the request is a get and the response is in the 30x range" do
196
+ stub_request(:get, 'http://some/resource').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://new/resource'})
197
+ stub_request(:get, 'http://new/resource').to_return(:body => 'Foo')
198
+ expect(RestClient::Request.execute(:url => 'http://some/resource', :method => :get).body).to eq 'Foo'
199
+ end
200
+
201
+ it "follows no more than 10 redirections before raising error" do
202
+ stub_request(:get, 'http://some/redirect-1').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
203
+ stub_request(:get, 'http://some/redirect-2').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
204
+ expect {
205
+ RestClient::Request.execute(url: 'http://some/redirect-1', method: :get)
206
+ }.to raise_error(RestClient::MovedPermanently) { |ex|
207
+ ex.response.history.each {|r| expect(r).to be_a(RestClient::Response) }
208
+ expect(ex.response.history.length).to eq 10
209
+ }
210
+ expect(WebMock).to have_requested(:get, 'http://some/redirect-2').times(10)
211
+ end
212
+
213
+ it "follows no more than max_redirects redirections, if specified" do
214
+ stub_request(:get, 'http://some/redirect-1').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
215
+ stub_request(:get, 'http://some/redirect-2').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/redirect-2'})
216
+ expect {
217
+ RestClient::Request.execute(url: 'http://some/redirect-1', method: :get, max_redirects: 5)
218
+ }.to raise_error(RestClient::MovedPermanently) { |ex|
219
+ expect(ex.response.history.length).to eq 5
220
+ }
221
+ expect(WebMock).to have_requested(:get, 'http://some/redirect-2').times(5)
222
+ end
223
+
224
+ it "allows for manual following of redirects" do
225
+ stub_request(:get, 'http://some/redirect-1').to_return(:body => '', :status => 301, :headers => {'Location' => 'http://some/resource'})
226
+ stub_request(:get, 'http://some/resource').to_return(:body => 'Qux', :status => 200)
227
+
228
+ begin
229
+ RestClient::Request.execute(url: 'http://some/redirect-1', method: :get, max_redirects: 0)
230
+ rescue RestClient::MovedPermanently => err
231
+ resp = err.response.follow_redirection
232
+ else
233
+ raise 'notreached'
234
+ end
235
+
236
+ expect(resp.code).to eq 200
237
+ expect(resp.body).to eq 'Qux'
238
+ end
239
+ end
240
+
241
+ end
@@ -0,0 +1,79 @@
1
+ require_relative '_lib'
2
+
3
+ describe RestClient do
4
+ describe "API" do
5
+ it "GET" do
6
+ expect(RestClient::Request).to receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {})
7
+ RestClient.get('http://some/resource')
8
+ end
9
+
10
+ it "POST" do
11
+ expect(RestClient::Request).to receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'payload', :headers => {})
12
+ RestClient.post('http://some/resource', 'payload')
13
+ end
14
+
15
+ it "PUT" do
16
+ expect(RestClient::Request).to receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'payload', :headers => {})
17
+ RestClient.put('http://some/resource', 'payload')
18
+ end
19
+
20
+ it "PATCH" do
21
+ expect(RestClient::Request).to receive(:execute).with(:method => :patch, :url => 'http://some/resource', :payload => 'payload', :headers => {})
22
+ RestClient.patch('http://some/resource', 'payload')
23
+ end
24
+
25
+ it "DELETE" do
26
+ expect(RestClient::Request).to receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => {})
27
+ RestClient.delete('http://some/resource')
28
+ end
29
+
30
+ it "HEAD" do
31
+ expect(RestClient::Request).to receive(:execute).with(:method => :head, :url => 'http://some/resource', :headers => {})
32
+ RestClient.head('http://some/resource')
33
+ end
34
+
35
+ it "OPTIONS" do
36
+ expect(RestClient::Request).to receive(:execute).with(:method => :options, :url => 'http://some/resource', :headers => {})
37
+ RestClient.options('http://some/resource')
38
+ end
39
+ end
40
+
41
+ describe "logging" do
42
+ after do
43
+ RestClient.log = nil
44
+ end
45
+
46
+ it "uses << if the log is not a string" do
47
+ log = RestClient.log = []
48
+ expect(log).to receive(:<<).with('xyz')
49
+ RestClient.log << 'xyz'
50
+ end
51
+
52
+ it "displays the log to stdout" do
53
+ RestClient.log = 'stdout'
54
+ expect(STDOUT).to receive(:puts).with('xyz')
55
+ RestClient.log << 'xyz'
56
+ end
57
+
58
+ it "displays the log to stderr" do
59
+ RestClient.log = 'stderr'
60
+ expect(STDERR).to receive(:puts).with('xyz')
61
+ RestClient.log << 'xyz'
62
+ end
63
+
64
+ it "append the log to the requested filename" do
65
+ RestClient.log = '/tmp/restclient.log'
66
+ f = double('file handle')
67
+ expect(File).to receive(:open).with('/tmp/restclient.log', 'a').and_yield(f)
68
+ expect(f).to receive(:puts).with('xyz')
69
+ RestClient.log << 'xyz'
70
+ end
71
+ end
72
+
73
+ describe 'version' do
74
+ it 'has a version ~> 2.0.0.alpha' do
75
+ ver = Gem::Version.new(RestClient.version)
76
+ expect(Gem::Requirement.new('~> 2.0.0.alpha')).to be_satisfied_by(ver)
77
+ end
78
+ end
79
+ end