vagrant-unbundled 1.9.7.1 → 1.9.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/Gemfile.lock +10 -6
  4. data/contrib/bash/completion.sh +1 -1
  5. data/contrib/sudoers/linux-ubuntu +3 -4
  6. data/lib/vagrant/errors.rb +8 -0
  7. data/lib/vagrant/machine.rb +2 -0
  8. data/lib/vagrant/util/platform.rb +1 -1
  9. data/lib/vagrant/util/powershell.rb +42 -13
  10. data/lib/vagrant/util/safe_exec.rb +13 -2
  11. data/lib/vagrant/util/ssh.rb +11 -1
  12. data/plugins/commands/box/command/update.rb +12 -7
  13. data/plugins/commands/login/client.rb +15 -6
  14. data/plugins/commands/login/command.rb +13 -3
  15. data/plugins/commands/up/command.rb +9 -0
  16. data/plugins/commands/validate/command.rb +4 -4
  17. data/plugins/guests/darwin/cap/shell_expand_guest_path.rb +2 -2
  18. data/plugins/guests/freebsd/cap/configure_networks.rb +1 -1
  19. data/plugins/guests/freebsd/cap/shell_expand_guest_path.rb +2 -2
  20. data/plugins/guests/linux/cap/shell_expand_guest_path.rb +2 -2
  21. data/plugins/guests/netbsd/cap/shell_expand_guest_path.rb +2 -2
  22. data/plugins/guests/openbsd/cap/shell_expand_guest_path.rb +2 -2
  23. data/plugins/guests/windows/cap/public_key.rb +21 -45
  24. data/plugins/kernel_v2/config/ssh_connect.rb +3 -0
  25. data/plugins/providers/docker/config.rb +4 -0
  26. data/plugins/providers/docker/driver/compose.rb +11 -4
  27. data/plugins/providers/hyperv/action/wait_for_ip_address.rb +15 -11
  28. data/plugins/providers/hyperv/scripts/get_network_config.ps1 +24 -9
  29. data/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +18 -0
  30. data/plugins/provisioners/ansible/provisioner/host.rb +1 -1
  31. data/plugins/provisioners/chef/cap/debian/chef_install.rb +2 -2
  32. data/plugins/provisioners/chef/cap/freebsd/chef_install.rb +2 -2
  33. data/plugins/provisioners/chef/cap/omnios/chef_install.rb +2 -2
  34. data/plugins/provisioners/chef/cap/redhat/chef_install.rb +2 -2
  35. data/plugins/provisioners/chef/cap/suse/chef_install.rb +2 -2
  36. data/plugins/provisioners/chef/cap/windows/chef_install.rb +2 -2
  37. data/plugins/provisioners/chef/config/base.rb +17 -0
  38. data/plugins/provisioners/chef/config/chef_zero.rb +7 -0
  39. data/plugins/provisioners/chef/installer.rb +8 -7
  40. data/plugins/provisioners/chef/omnibus.rb +4 -6
  41. data/plugins/provisioners/chef/provisioner/base.rb +1 -0
  42. data/plugins/provisioners/chef/provisioner/chef_solo.rb +2 -1
  43. data/plugins/provisioners/file/provisioner.rb +18 -2
  44. data/plugins/provisioners/puppet/provisioner/puppet.rb +0 -2
  45. data/plugins/provisioners/salt/bootstrap-salt.sh +9 -5
  46. data/plugins/provisioners/shell/provisioner.rb +1 -1
  47. data/plugins/synced_folders/rsync/command/rsync_auto.rb +6 -1
  48. data/plugins/synced_folders/rsync/helper.rb +10 -0
  49. data/templates/locales/en.yml +27 -1
  50. data/templates/locales/providers_docker.yml +2 -0
  51. data/test/unit/base.rb +1 -3
  52. data/test/unit/plugins/commands/box/command/add_test.rb +3 -3
  53. data/test/unit/plugins/commands/box/command/remove_test.rb +6 -6
  54. data/test/unit/plugins/commands/box/command/repackage_test.rb +2 -4
  55. data/test/unit/plugins/commands/box/command/update_test.rb +36 -14
  56. data/test/unit/plugins/commands/init/command_test.rb +1 -1
  57. data/test/unit/plugins/commands/list-commands/command_test.rb +2 -2
  58. data/test/unit/plugins/commands/login/client_test.rb +5 -1
  59. data/test/unit/plugins/commands/package/command_test.rb +1 -1
  60. data/test/unit/plugins/commands/plugin/action/expunge_plugins_test.rb +1 -1
  61. data/test/unit/plugins/commands/plugin/action/install_gem_test.rb +3 -3
  62. data/test/unit/plugins/commands/plugin/action/plugin_exists_check_test.rb +3 -3
  63. data/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb +1 -1
  64. data/test/unit/plugins/commands/plugin/action/update_gems_test.rb +2 -2
  65. data/test/unit/plugins/commands/port/command_test.rb +3 -3
  66. data/test/unit/plugins/commands/push/command_test.rb +1 -1
  67. data/test/unit/plugins/commands/snapshot/command/list_test.rb +2 -3
  68. data/test/unit/plugins/commands/ssh_config/command_test.rb +1 -1
  69. data/test/unit/plugins/commands/up/command_test.rb +69 -2
  70. data/test/unit/plugins/commands/validate/command_test.rb +47 -1
  71. data/test/unit/plugins/communicators/ssh/communicator_test.rb +5 -5
  72. data/test/unit/plugins/communicators/winrm/communicator_test.rb +6 -6
  73. data/test/unit/plugins/communicators/winrm/helper_test.rb +24 -23
  74. data/test/unit/plugins/communicators/winssh/communicator_test.rb +5 -5
  75. data/test/unit/plugins/guests/darwin/cap/shell_expand_guest_path_test.rb +43 -0
  76. data/test/unit/plugins/guests/freebsd/cap/configure_networks_test.rb +1 -1
  77. data/test/unit/plugins/guests/freebsd/cap/shell_expand_guest_path_test.rb +44 -0
  78. data/test/unit/plugins/guests/linux/cap/shell_expand_guest_path_test.rb +43 -0
  79. data/test/unit/plugins/guests/netbsd/cap/shell_expand_guest_path_test.rb +43 -0
  80. data/test/unit/plugins/guests/omnios/cap/mount_nfs_folder_test.rb +1 -3
  81. data/test/unit/plugins/guests/openbsd/cap/shell_expand_guest_path_test.rb +43 -0
  82. data/test/unit/plugins/guests/smartos/cap/change_host_name_test.rb +2 -2
  83. data/test/unit/plugins/guests/smartos/cap/configure_networks_test.rb +2 -2
  84. data/test/unit/plugins/guests/smartos/cap/halt_test.rb +2 -2
  85. data/test/unit/plugins/guests/smartos/cap/insert_public_key_test.rb +1 -1
  86. data/test/unit/plugins/guests/smartos/cap/mount_nfs_test.rb +2 -2
  87. data/test/unit/plugins/guests/smartos/cap/rsync_test.rb +2 -2
  88. data/test/unit/plugins/guests/windows/cap/insert_public_key_test.rb +2 -2
  89. data/test/unit/plugins/guests/windows/cap/remove_public_key_test.rb +4 -3
  90. data/test/unit/plugins/guests/windows/config_test.rb +1 -1
  91. data/test/unit/plugins/guests/windows/guest_network_test.rb +2 -2
  92. data/test/unit/plugins/hosts/linux/cap/nfs_test.rb +2 -0
  93. data/test/unit/plugins/kernel_v2/config/push_test.rb +1 -1
  94. data/test/unit/plugins/kernel_v2/config/vm_test.rb +7 -7
  95. data/test/unit/plugins/providers/docker/action/create_test.rb +1 -1
  96. data/test/unit/plugins/providers/docker/command/exec_test.rb +1 -1
  97. data/test/unit/plugins/providers/docker/config_test.rb +23 -4
  98. data/test/unit/plugins/providers/docker/driver_compose_test.rb +60 -30
  99. data/test/unit/plugins/providers/docker/driver_test.rb +31 -31
  100. data/test/unit/plugins/providers/docker/synced_folder_test.rb +3 -3
  101. data/test/unit/plugins/providers/hyperv/provider_test.rb +19 -19
  102. data/test/unit/plugins/providers/virtualbox/action/network_fix_ipv6_test.rb +2 -2
  103. data/test/unit/plugins/providers/virtualbox/action/network_test.rb +1 -1
  104. data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +34 -8
  105. data/test/unit/plugins/providers/virtualbox/action/prepare_nfs_valid_ids_test.rb +3 -3
  106. data/test/unit/plugins/providers/virtualbox/cap_test.rb +2 -2
  107. data/test/unit/plugins/providers/virtualbox/config_test.rb +6 -6
  108. data/test/unit/plugins/providers/virtualbox/synced_folder_test.rb +6 -8
  109. data/test/unit/plugins/provisioners/ansible/config/guest_test.rb +1 -1
  110. data/test/unit/plugins/provisioners/ansible/config/host_test.rb +4 -4
  111. data/test/unit/plugins/provisioners/ansible/config/shared.rb +2 -2
  112. data/test/unit/plugins/provisioners/ansible/provisioner_test.rb +165 -157
  113. data/test/unit/plugins/provisioners/chef/command_builder_test.rb +2 -2
  114. data/test/unit/plugins/provisioners/chef/config/base_test.rb +13 -0
  115. data/test/unit/plugins/provisioners/chef/config/chef_zero_test.rb +11 -0
  116. data/test/unit/plugins/provisioners/chef/omnibus_test.rb +17 -7
  117. data/test/unit/plugins/provisioners/docker/config_test.rb +2 -1
  118. data/test/unit/plugins/provisioners/docker/provisioner_test.rb +13 -13
  119. data/test/unit/plugins/provisioners/file/provisioner_test.rb +32 -14
  120. data/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb +51 -0
  121. data/test/unit/plugins/provisioners/salt/provisioner_test.rb +5 -5
  122. data/test/unit/plugins/provisioners/shell/provisioner_test.rb +35 -4
  123. data/test/unit/plugins/pushes/ftp/adapter_test.rb +1 -0
  124. data/test/unit/plugins/synced_folders/nfs/action_cleanup_test.rb +1 -1
  125. data/test/unit/plugins/synced_folders/nfs/config_test.rb +1 -1
  126. data/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb +44 -12
  127. data/test/unit/plugins/synced_folders/rsync/command/rsync_test.rb +5 -5
  128. data/test/unit/plugins/synced_folders/rsync/helper_test.rb +47 -29
  129. data/test/unit/plugins/synced_folders/rsync/synced_folder_test.rb +5 -5
  130. data/test/unit/vagrant/action/builtin/box_add_test.rb +27 -27
  131. data/test/unit/vagrant/action/builtin/box_check_outdated_test.rb +10 -10
  132. data/test/unit/vagrant/action/builtin/box_remove_test.rb +15 -15
  133. data/test/unit/vagrant/action/builtin/confirm_test.rb +1 -1
  134. data/test/unit/vagrant/action/builtin/graceful_halt_test.rb +2 -2
  135. data/test/unit/vagrant/action/builtin/handle_box_test.rb +8 -8
  136. data/test/unit/vagrant/action/builtin/handle_forwarded_port_collisions_test.rb +1 -1
  137. data/test/unit/vagrant/action/builtin/is_env_set_test.rb +2 -2
  138. data/test/unit/vagrant/action/builtin/is_state_test.rb +6 -6
  139. data/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb +6 -6
  140. data/test/unit/vagrant/action/builtin/provision_test.rb +1 -1
  141. data/test/unit/vagrant/action/builtin/provisioner_cleanup_test.rb +1 -1
  142. data/test/unit/vagrant/action/builtin/synced_folder_cleanup_test.rb +6 -6
  143. data/test/unit/vagrant/action/builtin/synced_folders_test.rb +3 -3
  144. data/test/unit/vagrant/batch_action_test.rb +2 -2
  145. data/test/unit/vagrant/box_collection_test.rb +1 -1
  146. data/test/unit/vagrant/box_test.rb +6 -6
  147. data/test/unit/vagrant/capability_host_test.rb +3 -3
  148. data/test/unit/vagrant/cli_test.rb +3 -3
  149. data/test/unit/vagrant/environment_test.rb +21 -20
  150. data/test/unit/vagrant/guest_test.rb +7 -7
  151. data/test/unit/vagrant/machine_index_test.rb +4 -4
  152. data/test/unit/vagrant/machine_test.rb +28 -17
  153. data/test/unit/vagrant/plugin/manager_test.rb +12 -12
  154. data/test/unit/vagrant/plugin/state_file_test.rb +2 -2
  155. data/test/unit/vagrant/plugin/v1/command_test.rb +9 -8
  156. data/test/unit/vagrant/plugin/v2/command_test.rb +54 -43
  157. data/test/unit/vagrant/plugin/v2/plugin_test.rb +4 -3
  158. data/test/unit/vagrant/plugin/v2/provider_test.rb +3 -3
  159. data/test/unit/vagrant/shared_helpers_test.rb +6 -6
  160. data/test/unit/vagrant/ui_test.rb +21 -21
  161. data/test/unit/vagrant/util/downloader_test.rb +7 -7
  162. data/test/unit/vagrant/util/ssh_test.rb +41 -5
  163. data/test/unit/vagrant/util/subprocess_test.rb +7 -7
  164. data/test/unit/vagrant_test.rb +9 -9
  165. data/vagrant.gemspec +3 -2
  166. data/vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-spec-af86757912f7/vagrant-spec.gemspec +1 -1
  167. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.gitignore +7 -0
  168. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.rspec +2 -0
  169. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/.travis.yml +5 -0
  170. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/CONTRIBUTORS.md +19 -0
  171. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile +12 -0
  172. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Gemfile.lock +44 -0
  173. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Guardfile +10 -0
  174. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/README.md +134 -0
  175. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/Rakefile +10 -0
  176. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/fake_ftp.gemspec +22 -0
  177. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp.rb +5 -0
  178. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/file.rb +34 -0
  179. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/server.rb +340 -0
  180. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/lib/fake_ftp/version.rb +3 -0
  181. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/invisible_bike.jpg +0 -0
  182. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/fixtures/text_file.txt +1 -0
  183. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/functional/server_spec.rb +468 -0
  184. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/integration/server_spec.rb +81 -0
  185. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/file_spec.rb +102 -0
  186. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/models/fake_ftp/server_spec.rb +76 -0
  187. data/vendor/bundle/ruby/2.4.0/gems/fake_ftp-0.1.1/spec/spec_helper.rb +18 -0
  188. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.gitignore +14 -0
  189. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.rubocop.yml +57 -0
  190. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/.travis.yml +21 -0
  191. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/CONTRIBUTING.rdoc +36 -0
  192. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Gemfile +3 -0
  193. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/History.rdoc +2247 -0
  194. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/MIT-LICENSE +21 -0
  195. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/README.rdoc +156 -0
  196. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/Rakefile +38 -0
  197. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/appveyor.yml +21 -0
  198. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/console +7 -0
  199. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/bin/setup +6 -0
  200. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/command_line_usage.rdoc +158 -0
  201. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile1 +38 -0
  202. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/Rakefile2 +35 -0
  203. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/a.c +6 -0
  204. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/b.c +6 -0
  205. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/example/main.c +11 -0
  206. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/glossary.rdoc +42 -0
  207. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/jamis.rb +591 -0
  208. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/proto_rake.rdoc +127 -0
  209. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rake.1 +156 -0
  210. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rakefile.rdoc +622 -0
  211. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/doc/rational.rdoc +151 -0
  212. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake +27 -0
  213. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake.rb +70 -0
  214. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/application.rb +785 -0
  215. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/backtrace.rb +23 -0
  216. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/clean.rb +77 -0
  217. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cloneable.rb +16 -0
  218. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/cpu_counter.rb +106 -0
  219. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/default_loader.rb +14 -0
  220. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/dsl_definition.rb +194 -0
  221. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/early_time.rb +21 -0
  222. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/core.rb +25 -0
  223. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/ext/string.rb +175 -0
  224. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_creation_task.rb +24 -0
  225. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_list.rb +434 -0
  226. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_task.rb +46 -0
  227. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils.rb +136 -0
  228. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/file_utils_ext.rb +144 -0
  229. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_chain.rb +56 -0
  230. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/invocation_exception_mixin.rb +16 -0
  231. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/late_time.rb +17 -0
  232. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/linked_list.rb +111 -0
  233. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/loaders/makefile.rb +53 -0
  234. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/multi_task.rb +49 -0
  235. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/name_space.rb +37 -0
  236. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/packagetask.rb +210 -0
  237. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/phony.rb +15 -0
  238. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/private_reader.rb +20 -0
  239. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/promise.rb +99 -0
  240. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/pseudo_status.rb +29 -0
  241. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_module.rb +38 -0
  242. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rake_test_loader.rb +21 -0
  243. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/rule_recursion_overflow_error.rb +19 -0
  244. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/scope.rb +42 -0
  245. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb +390 -0
  246. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_argument_error.rb +7 -0
  247. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_arguments.rb +108 -0
  248. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task_manager.rb +303 -0
  249. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/tasklib.rb +11 -0
  250. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/testtask.rb +222 -0
  251. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_history_display.rb +48 -0
  252. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/thread_pool.rb +162 -0
  253. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/trace_output.rb +22 -0
  254. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/version.rb +9 -0
  255. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/win32.rb +50 -0
  256. data/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/rake.gemspec +39 -0
  257. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.gitignore +19 -0
  258. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.rspec +3 -0
  259. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/.travis.yml +24 -0
  260. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Changelog.md +49 -0
  261. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Gemfile +26 -0
  262. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/LICENSE.txt +27 -0
  263. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/README.md +72 -0
  264. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/Rakefile +16 -0
  265. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/cucumber.yml +2 -0
  266. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/its.feature +125 -0
  267. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/step_definitions/additional_cli_steps.rb +21 -0
  268. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/features/support/env.rb +23 -0
  269. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its.rb +149 -0
  270. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/lib/rspec/its/version.rb +5 -0
  271. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/rspec-its.gemspec +28 -0
  272. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/script/test_all +20 -0
  273. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/rspec/its_spec.rb +237 -0
  274. data/vendor/bundle/ruby/2.4.0/gems/rspec-its-1.2.0/spec/spec_helper.rb +15 -0
  275. data/vendor/bundle/ruby/2.4.0/specifications/fake_ftp-0.1.1.gemspec +20 -0
  276. data/vendor/bundle/ruby/2.4.0/specifications/rake-12.0.0.gemspec +43 -0
  277. data/vendor/bundle/ruby/2.4.0/specifications/rspec-its-1.2.0.gemspec +47 -0
  278. data/version.txt +1 -1
  279. metadata +137 -7
  280. data/2.14.0 +0 -5
@@ -20,8 +20,8 @@ describe VagrantPlugins::Chef::CommandBuilder do
20
20
 
21
21
  describe ".initialize" do
22
22
  it "raises an error when chef type is not client or solo" do
23
- expect { VagrantPlugins::Chef::CommandBuilder.new(chef_config, :client_bad) }.
24
- to raise_error
23
+ expect { VagrantPlugins::Chef::CommandBuilder.new(:client_bad, chef_config) }.
24
+ to raise_error(RuntimeError)
25
25
  end
26
26
 
27
27
  it "does not raise an error for :client" do
@@ -82,4 +82,17 @@ describe VagrantPlugins::Chef::Config::Base do
82
82
  expect(subject.installer_download_path).to be(nil)
83
83
  end
84
84
  end
85
+
86
+ describe "#omnibus_url" do
87
+ it "defaults to https://omnitruck.chef.io" do
88
+ subject.finalize!
89
+ expect(subject.omnibus_url).to eq("https://omnitruck.chef.io")
90
+ end
91
+
92
+ it "makes use of the configured url" do
93
+ subject.omnibus_url = "https://omnitruck.example.com"
94
+ subject.finalize!
95
+ expect(subject.omnibus_url).to eq("https://omnitruck.example.com")
96
+ end
97
+ end
85
98
  end
@@ -110,6 +110,17 @@ describe VagrantPlugins::Chef::Config::ChefZero do
110
110
  end
111
111
  end
112
112
 
113
+ context "when an element of nodes_path does not exist on disk" do
114
+ it "returns an error" do
115
+ nodes_path = ["/path/to/nodes/that/will/never/exist"]
116
+ subject.nodes_path = nodes_path
117
+ subject.finalize!
118
+ expect(errors).to include(I18n.t("vagrant.config.chef.nodes_path_missing",
119
+ path: nodes_path
120
+ ))
121
+ end
122
+ end
123
+
113
124
  context "when the nodes_path is an empty array" do
114
125
  it "returns an error" do
115
126
  subject.nodes_path = []
@@ -5,22 +5,27 @@ require Vagrant.source_root.join("plugins/provisioners/chef/omnibus")
5
5
  describe VagrantPlugins::Chef::Omnibus do
6
6
  describe "#sh_command" do
7
7
  it "includes the project name" do
8
- command = described_class.sh_command("chef", nil, "stable")
8
+ command = described_class.sh_command("chef", nil, "stable", "https://omnitruck.chef.io")
9
9
  expect(command).to include %|-P "chef"|
10
10
  end
11
11
 
12
12
  it "includes the channel" do
13
- command = described_class.sh_command("chef", nil, "stable")
13
+ command = described_class.sh_command("chef", nil, "stable", "https://omnitruck.chef.io")
14
14
  expect(command).to include %|-c "stable"|
15
15
  end
16
16
 
17
17
  it "includes the version" do
18
- command = described_class.sh_command("chef", "1.2.3", "stable")
18
+ command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
19
19
  expect(command).to include %|-v "1.2.3"|
20
20
  end
21
21
 
22
+ it "includes the Omnibus installation URL" do
23
+ command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
24
+ expect(command).to include %|https://omnitruck.chef.io/install.sh|
25
+ end
26
+
22
27
  it "includes the download path" do
23
- command = described_class.sh_command("chef", "1.2.3", "stable",
28
+ command = described_class.sh_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io",
24
29
  download_path: "/some/path",
25
30
  )
26
31
  expect(command).to include %|-d "/some/path"|
@@ -29,18 +34,23 @@ describe VagrantPlugins::Chef::Omnibus do
29
34
 
30
35
  describe "#ps_command" do
31
36
  it "includes the project name" do
32
- command = described_class.ps_command("chef", nil, "stable")
37
+ command = described_class.ps_command("chef", nil, "stable", "https://omnitruck.chef.io")
33
38
  expect(command).to include %|-project 'chef'|
34
39
  end
35
40
 
36
41
  it "includes the channel" do
37
- command = described_class.ps_command("chef", nil, "stable")
42
+ command = described_class.ps_command("chef", nil, "stable", "https://omnitruck.chef.io")
38
43
  expect(command).to include %|-channel 'stable'|
39
44
  end
40
45
 
41
46
  it "includes the version" do
42
- command = described_class.ps_command("chef", "1.2.3", "stable")
47
+ command = described_class.ps_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
43
48
  expect(command).to include %|-version '1.2.3'|
44
49
  end
50
+
51
+ it "includes the Omnibus installation URL" do
52
+ command = described_class.ps_command("chef", "1.2.3", "stable", "https://omnitruck.chef.io")
53
+ expect(command).to include %|https://omnitruck.chef.io/install.ps1|
54
+ end
45
55
  end
46
56
  end
@@ -1,6 +1,7 @@
1
1
  require File.expand_path("../../../../base", __FILE__)
2
2
 
3
3
  require Vagrant.source_root.join("plugins/provisioners/docker/config")
4
+ require Vagrant.source_root.join("plugins/provisioners/docker/provisioner")
4
5
  require Vagrant.source_root.join("plugins/kernel_v2/config/vm")
5
6
 
6
7
  describe VagrantPlugins::DockerProvisioner::Config do
@@ -142,7 +143,7 @@ describe VagrantPlugins::DockerProvisioner::Config do
142
143
  describe "#post_install_provision" do
143
144
  it "raises an error if 'docker' provisioner was provided" do
144
145
  expect {subject.post_install_provision("myprov", :type=>"docker", :inline=>"echo 'hello'")}
145
- .to raise_error()
146
+ .to raise_error(VagrantPlugins::DockerProvisioner::DockerError)
146
147
  end
147
148
 
148
149
  it "setups a basic provisioner" do
@@ -22,21 +22,21 @@ describe VagrantPlugins::DockerProvisioner::Provisioner do
22
22
  let(:hook) { double("hook") }
23
23
 
24
24
  before do
25
- machine.stub(communicate: communicator)
26
- machine.stub(guest: guest)
25
+ allow(machine).to receive(:communicate).and_return(communicator)
26
+ allow(machine).to receive(:guest).and_return(guest)
27
27
 
28
- communicator.stub(execute: true)
29
- communicator.stub(upload: true)
28
+ allow(communicator).to receive(:execute).and_return(true)
29
+ allow(communicator).to receive(:upload).and_return(true)
30
30
 
31
- guest.stub(capability?: false)
32
- guest.stub(capability: false)
31
+ allow(guest).to receive(:capability?).and_return(false)
32
+ allow(guest).to receive(:capability).and_return(false)
33
33
 
34
- client.stub(start_service: true)
35
- client.stub(daemon_running?: true)
34
+ allow(client).to receive(:start_service).and_return(true)
35
+ allow(client).to receive(:daemon_running?).and_return(true)
36
36
 
37
- config.stub(images: Set.new)
38
- config.stub(build_images: Set.new)
39
- config.stub(containers: Hash.new)
37
+ allow(config).to receive(:images).and_return(Set.new)
38
+ allow(config).to receive(:build_images).and_return(Set.new)
39
+ allow(config).to receive(:containers).and_return(Hash.new)
40
40
  end
41
41
 
42
42
  describe "#provision" do
@@ -47,7 +47,7 @@ describe VagrantPlugins::DockerProvisioner::Provisioner do
47
47
  end
48
48
 
49
49
  it "invokes a post_install_provisioner if defined and docker is installed" do
50
- installer.stub(ensure_installed: true)
50
+ allow(installer).to receive(:ensure_installed).and_return(true)
51
51
  allow(config).to receive(:post_install_provisioner).and_return(provisioner)
52
52
  allow(machine).to receive(:env).and_return(iso_env)
53
53
  allow(machine.env).to receive(:hook).and_return(true)
@@ -57,7 +57,7 @@ describe VagrantPlugins::DockerProvisioner::Provisioner do
57
57
  end
58
58
 
59
59
  it "does not invoke post_install_provisioner if not defined" do
60
- installer.stub(ensure_installed: true)
60
+ allow(installer).to receive(:ensure_installed).and_return(true)
61
61
  allow(config).to receive(:post_install_provisioner).and_return(nil)
62
62
  allow(machine).to receive(:env).and_return(iso_env)
63
63
  allow(machine.env).to receive(:hook).and_return(true)
@@ -20,28 +20,46 @@ describe VagrantPlugins::FileUpload::Provisioner do
20
20
  let(:guest) { double("guest") }
21
21
 
22
22
  before do
23
- machine.stub(communicate: communicator)
24
- machine.stub(guest: guest)
23
+ allow(machine).to receive(:communicate).and_return(communicator)
24
+ allow(machine).to receive(:guest).and_return(guest)
25
25
 
26
- communicator.stub(execute: true)
27
- communicator.stub(upload: true)
26
+ allow(communicator).to receive(:execute).and_return(true)
27
+ allow(communicator).to receive(:upload).and_return(true)
28
28
 
29
- guest.stub(capability?: false)
29
+ allow(guest).to receive(:capability?).and_return(false)
30
30
  end
31
31
 
32
32
  describe "#provision" do
33
33
  it "creates the destination directory" do
34
- config.stub(source: "/source")
35
- config.stub(destination: "/foo/bar")
34
+ allow(config).to receive(:source).and_return("/source")
35
+ allow(config).to receive(:destination).and_return("/foo/bar")
36
36
 
37
- expect(communicator).to receive(:execute).with("mkdir -p /foo")
37
+ expect(communicator).to receive(:execute).with("mkdir -p \"/foo\"")
38
+
39
+ subject.provision
40
+ end
41
+
42
+ it "creates the destination directory with a space" do
43
+ allow(config).to receive(:source).and_return("/source")
44
+ allow(config).to receive(:destination).and_return("/foo bar/bar")
45
+
46
+ expect(communicator).to receive(:execute).with("mkdir -p \"/foo bar\"")
47
+
48
+ subject.provision
49
+ end
50
+
51
+ it "creates the destination directory above file" do
52
+ allow(config).to receive(:source).and_return("/source/file.sh")
53
+ allow(config).to receive(:destination).and_return("/foo/bar/file.sh")
54
+
55
+ expect(communicator).to receive(:execute).with("mkdir -p \"/foo/bar\"")
38
56
 
39
57
  subject.provision
40
58
  end
41
59
 
42
60
  it "uploads the file" do
43
- config.stub(source: "/source")
44
- config.stub(destination: "/foo/bar")
61
+ allow(config).to receive(:source).and_return("/source")
62
+ allow(config).to receive(:destination).and_return("/foo/bar")
45
63
 
46
64
  expect(communicator).to receive(:upload).with("/source", "/foo/bar")
47
65
 
@@ -49,8 +67,8 @@ describe VagrantPlugins::FileUpload::Provisioner do
49
67
  end
50
68
 
51
69
  it "expands the source file path" do
52
- config.stub(source: "source")
53
- config.stub(destination: "/foo/bar")
70
+ allow(config).to receive(:source).and_return("source")
71
+ allow(config).to receive(:destination).and_return("/foo/bar")
54
72
 
55
73
  expect(communicator).to receive(:upload).with(
56
74
  File.expand_path("source"), "/foo/bar")
@@ -59,8 +77,8 @@ describe VagrantPlugins::FileUpload::Provisioner do
59
77
  end
60
78
 
61
79
  it "expands the destination file path if capable" do
62
- config.stub(source: "/source")
63
- config.stub(destination: "$HOME/foo")
80
+ allow(config).to receive(:source).and_return("/source")
81
+ allow(config).to receive(:destination).and_return("$HOME/foo")
64
82
 
65
83
  expect(guest).to receive(:capability?).
66
84
  with(:shell_expand_guest_path).and_return(true)
@@ -0,0 +1,51 @@
1
+ require File.expand_path("../../../../../base", __FILE__)
2
+
3
+ require Vagrant.source_root.join("plugins/provisioners/puppet/provisioner/puppet")
4
+
5
+ describe VagrantPlugins::Puppet::Provisioner::Puppet do
6
+ include_context "unit"
7
+
8
+ let(:iso_env) do
9
+ # We have to create a Vagrantfile so there is a root path
10
+ env = isolated_environment
11
+ env.vagrantfile("")
12
+ env.create_vagrant_env
13
+ end
14
+
15
+ let(:machine) { iso_env.machine(iso_env.machine_names[0], :dummy) }
16
+ let(:config) { double("config") }
17
+ let(:facts) { [] }
18
+ let(:communicator) { double("comm") }
19
+ let(:guest) { double("guest") }
20
+ let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
21
+ let(:module_paths) { ["etc/puppet/modules"] } # make this something real
22
+
23
+ subject { described_class.new(machine, config) }
24
+
25
+ before do
26
+ allow(machine).to receive(:communicate).and_return(comm)
27
+ end
28
+
29
+ describe "#run_puppet_apply" do
30
+ let(:options) { double("options") }
31
+ let(:binary_path) { "/opt/puppetlabs/bin" }
32
+ let(:manifest_file) { "default.pp" }
33
+
34
+ it "runs puppet on a manifest" do
35
+ allow(config).to receive(:options).and_return(options)
36
+ allow(config).to receive(:environment_path).and_return(false)
37
+ allow(config).to receive(:facter).and_return(facts)
38
+ allow(config).to receive(:binary_path).and_return(binary_path)
39
+ allow(config).to receive(:environment_variables).and_return(nil)
40
+ allow(config).to receive(:working_directory).and_return(false)
41
+ allow(config).to receive(:manifest_file).and_return(manifest_file)
42
+
43
+ allow_message_expectations_on_nil
44
+ allow(@module_paths).to receive(:map) { module_paths }
45
+ allow(@module_paths).to receive(:empty?).and_return(true)
46
+
47
+ expect(machine).to receive(:communicate).and_return(comm)
48
+ subject.run_puppet_apply()
49
+ end
50
+ end
51
+ end
@@ -20,13 +20,13 @@ describe VagrantPlugins::Salt::Provisioner do
20
20
  let(:guest) { double("guest") }
21
21
 
22
22
  before do
23
- machine.stub(communicate: communicator)
24
- machine.stub(guest: guest)
23
+ allow(machine).to receive(:communicate).and_return(communicator)
24
+ allow(machine).to receive(:guest).and_return(guest)
25
25
 
26
- communicator.stub(execute: true)
27
- communicator.stub(upload: true)
26
+ allow(communicator).to receive(:execute).and_return(true)
27
+ allow(communicator).to receive(:upload).and_return(true)
28
28
 
29
- guest.stub(capability?: false)
29
+ allow(guest).to receive(:capability?).and_return(false)
30
30
  end
31
31
 
32
32
  describe "#provision" do
@@ -7,8 +7,8 @@ describe "Vagrant::Shell::Provisioner" do
7
7
  let(:env){ isolated_environment }
8
8
  let(:machine) {
9
9
  double(:machine, env: env, id: "ID").tap { |machine|
10
- machine.stub_chain(:config, :vm, :communicator).and_return(:not_winrm)
11
- machine.stub_chain(:communicate, :tap) {}
10
+ allow(machine).to receive_message_chain(:config, :vm, :communicator).and_return(:not_winrm)
11
+ allow(machine).to receive_message_chain(:communicate, :tap) {}
12
12
  }
13
13
  }
14
14
 
@@ -43,6 +43,37 @@ describe "Vagrant::Shell::Provisioner" do
43
43
  end
44
44
  end
45
45
 
46
+ context "with a script that was set to freeze the string" do
47
+ TEST_CONSTANT_VARIABLE = <<-TEST_CONSTANT_VARIABLE.freeze
48
+ echo test
49
+ TEST_CONSTANT_VARIABLE
50
+
51
+ let(:script) { TEST_CONSTANT_VARIABLE }
52
+ let(:config) {
53
+ double(
54
+ :config,
55
+ :args => "doesn't matter",
56
+ :env => {},
57
+ :upload_path => "arbitrary",
58
+ :remote? => false,
59
+ :path => nil,
60
+ :inline => script,
61
+ :binary => false,
62
+ )
63
+ }
64
+
65
+ it "does not raise an exception" do
66
+ vsp = VagrantPlugins::Shell::Provisioner.new(machine, config)
67
+
68
+ RSpec::Expectations.configuration.on_potential_false_positives = :nothing
69
+ # This test should be fine, since we are specifically looking for the
70
+ # string 'freeze' when RuntimeError is raised
71
+ expect {
72
+ vsp.provision
73
+ }.not_to raise_error(RuntimeError)
74
+ end
75
+ end
76
+
46
77
  context "with remote script" do
47
78
 
48
79
  context "that does not have matching sha1 checksum" do
@@ -62,7 +93,7 @@ describe "Vagrant::Shell::Provisioner" do
62
93
 
63
94
  let(:digest){ double("digest") }
64
95
  before do
65
- Vagrant::Util::Downloader.any_instance.should_receive(:execute_curl).and_return(true)
96
+ allow_any_instance_of(Vagrant::Util::Downloader).to receive(:execute_curl).and_return(true)
66
97
  allow(digest).to receive(:file).and_return(digest)
67
98
  expect(Digest::SHA1).to receive(:new).and_return(digest)
68
99
  expect(digest).to receive(:hexdigest).and_return('INVALID_VALUE')
@@ -92,7 +123,7 @@ describe "Vagrant::Shell::Provisioner" do
92
123
 
93
124
  let(:digest){ double("digest") }
94
125
  before do
95
- Vagrant::Util::Downloader.any_instance.should_receive(:execute_curl).and_return(true)
126
+ allow_any_instance_of(Vagrant::Util::Downloader).to receive(:execute_curl).and_return(true)
96
127
  allow(digest).to receive(:file).and_return(digest)
97
128
  expect(Digest::MD5).to receive(:new).and_return(digest)
98
129
  expect(digest).to receive(:hexdigest).and_return('INVALID_VALUE')
@@ -109,6 +109,7 @@ describe VagrantPlugins::FTPPush::SFTPAdapter do
109
109
  describe "#upload" do
110
110
  it "uploads the file" do
111
111
  pending "a way to mock an SFTP server"
112
+ test_with_mock_sftp_server
112
113
  end
113
114
  end
114
115
  end
@@ -23,7 +23,7 @@ describe VagrantPlugins::SyncedFolderNFS::ActionCleanup do
23
23
  subject { described_class.new(app, env) }
24
24
 
25
25
  before do
26
- machine.env.stub(host: host)
26
+ allow(machine.env).to receive(:host).and_return(host)
27
27
  end
28
28
 
29
29
  it "does nothing if there are no valid IDs" do
@@ -10,7 +10,7 @@ describe VagrantPlugins::SyncedFolderNFS::Config do
10
10
  subject.finalize!
11
11
  end
12
12
 
13
- its(:functional) { should be_true }
13
+ its(:functional) { should be(true) }
14
14
  its(:map_gid) { should eq(:auto) }
15
15
  its(:map_uid) { should eq(:auto) }
16
16
  end
@@ -21,7 +21,11 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
21
21
  "5678":
22
22
  {type: "rsync",
23
23
  exclude: false,
24
- hostpath: "/Not/The/Same/Path"}} }
24
+ hostpath: "/Not/The/Same/Path"},
25
+ "0912":
26
+ {type: "rsync",
27
+ exclude: false,
28
+ hostpath: "/Users/brian/code/relative-dir"}}}
25
29
 
26
30
  let(:helper_class) { VagrantPlugins::SyncedFolderRSync::RsyncHelper }
27
31
 
@@ -30,15 +34,17 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
30
34
 
31
35
  def machine_stub(name)
32
36
  double(name).tap do |m|
33
- m.stub(id: "foo")
34
- m.stub(reload: nil)
35
- m.stub(ssh_info: ssh_info)
36
- m.stub(ui: iso_env.ui)
37
- m.stub(provider: double("provider"))
38
- m.stub(state: double("state", id: :not_created))
39
- m.stub(env: iso_env)
40
-
41
- m.ui.stub(error: nil)
37
+ allow(m).to receive(:id).and_return("foo")
38
+ allow(m).to receive(:reload).and_return(nil)
39
+ allow(m).to receive(:ssh_info).and_return(ssh_info)
40
+ allow(m).to receive(:ui).and_return(iso_env.ui)
41
+ allow(m).to receive(:provider).and_return(double("provider"))
42
+ allow(m).to receive(:state).and_return(double("state", id: :not_created))
43
+ allow(m).to receive(:env).and_return(iso_env)
44
+ allow(m).to receive(:config).and_return(double("config"))
45
+
46
+
47
+ allow(m.ui).to receive(:error).and_return(nil)
42
48
  end
43
49
  end
44
50
 
@@ -51,6 +57,26 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
51
57
  let (:machine) { machine_stub("m") }
52
58
  let (:cached_folders) { { rsync: synced_folders_dupe } }
53
59
 
60
+ # NOTE: `relative-dir` is not actually a "relative dir" in this data structure
61
+ # due to the fact that when vagrant stores synced folders, it path expands
62
+ # them with root_dir, and when you grab those synced_folders options from
63
+ # the machines config file, they end up being a full path rather than a
64
+ # relative path, and so these tests reflect that.
65
+ # For reference:
66
+ # https://github.com/mitchellh/vagrant/blob/9c1b014536e61b332cfaa00774a87a240cce8ed9/lib/vagrant/action/builtin/synced_folders.rb#L45-L46
67
+ let(:config_synced_folders) { {"/vagrant":
68
+ {type: "rsync",
69
+ exclude: false,
70
+ hostpath: "/Users/brian/code/vagrant-sandbox"},
71
+ "/vagrant/other-dir":
72
+ {type: "rsync",
73
+ exclude: false,
74
+ hostpath: "/Users/brian/code/vagrant-sandbox/other-dir"},
75
+ "/vagrant/relative-dir":
76
+ {type: "rsync",
77
+ exclude: false,
78
+ hostpath: "/Users/brian/code/relative-dir"}}}
79
+
54
80
  before do
55
81
  allow(subject).to receive(:with_target_vms) { |&block| block.call machine }
56
82
  end
@@ -61,6 +87,8 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
61
87
  allow(machine.env).to receive(:cwd).
62
88
  and_return("/Users/brian/code/vagrant-sandbox")
63
89
  allow(machine.provider).to receive(:capability?).and_return(false)
90
+ allow(machine.config).to receive(:vm).and_return(true)
91
+ allow(machine.config.vm).to receive(:synced_folders).and_return(config_synced_folders)
64
92
 
65
93
  allow(subject).to receive(:synced_folders).
66
94
  with(machine, cached: true).and_return(cached_folders)
@@ -71,6 +99,10 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
71
99
 
72
100
  expect(machine.ui).to receive(:info).
73
101
  with("Not syncing /Not/The/Same/Path as it is not part of the current working directory.")
102
+ expect(machine.ui).to receive(:info).
103
+ with("Watching: /Users/brian/code/vagrant-sandbox")
104
+ expect(machine.ui).to receive(:info).
105
+ with("Watching: /Users/brian/code/relative-dir")
74
106
  expect(helper_class).to receive(:rsync_single)
75
107
 
76
108
  subject.execute()
@@ -79,7 +111,7 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
79
111
 
80
112
  subject do
81
113
  described_class.new(argv, iso_env).tap do |s|
82
- s.stub(synced_folders: synced_folders_empty)
114
+ allow(s).to receive(:synced_folders).and_return(synced_folders_empty)
83
115
  end
84
116
  end
85
117
 
@@ -175,7 +207,7 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do
175
207
  ]
176
208
 
177
209
  paths["/foo"].each do |data|
178
- data[:machine].stub(id: nil)
210
+ allow(data[:machine]).to receive(:id).and_return(nil)
179
211
  expect(helper_class).to_not receive(:rsync_single)
180
212
  end
181
213