From 0b02deb37a2a863e698513188ec6b123250e9b20 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 8 Jul 2011 12:07:27 -0700 Subject: [PATCH] Share folders go into the modify pipeline --- lib/vagrant/action/vm/share_folders.rb | 4 +++- test/vagrant/action/vm/share_folders_test.rb | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/action/vm/share_folders.rb b/lib/vagrant/action/vm/share_folders.rb index ee24172cc..7975aabbe 100644 --- a/lib/vagrant/action/vm/share_folders.rb +++ b/lib/vagrant/action/vm/share_folders.rb @@ -33,7 +33,7 @@ module Vagrant end def create_metadata - @env["config"].vm.customize do |vm| + proc = lambda do |vm| @env.ui.info I18n.t("vagrant.actions.vm.share_folders.creating") shared_folders.each do |name, data| @@ -43,6 +43,8 @@ module Vagrant vm.shared_folders << folder end end + + @env["vm.modify"].call(proc) end def mount_shared_folders diff --git a/test/vagrant/action/vm/share_folders_test.rb b/test/vagrant/action/vm/share_folders_test.rb index e29efbdbb..747d1dd12 100644 --- a/test/vagrant/action/vm/share_folders_test.rb +++ b/test/vagrant/action/vm/share_folders_test.rb @@ -10,6 +10,7 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase @vm.stubs(:ssh).returns(mock("ssh")) @vm.stubs(:system).returns(mock("system")) @env["vm"] = @vm + @env["vm.modify"] = mock("proc") @internal_vm = mock("internal") @vm.stubs(:vm).returns(@internal_vm) @@ -106,7 +107,11 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase @internal_vm.stubs(:shared_folders).returns(shared_folders) - @env["config"].vm.expects(:customize).yields(@internal_vm) + @env["vm.modify"].expects(:call).with() do |proc| + proc.call(@internal_vm) + true + end + @instance.create_metadata end end