Skip to content

Commit

Permalink
Share folders go into the modify pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jul 8, 2011
1 parent d797e48 commit 0b02deb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/vagrant/action/vm/share_folders.rb
Expand Up @@ -33,7 +33,7 @@ def shared_folders
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|
Expand All @@ -43,6 +43,8 @@ def create_metadata
vm.shared_folders << folder
end
end

@env["vm.modify"].call(proc)
end

def mount_shared_folders
Expand Down
7 changes: 6 additions & 1 deletion test/vagrant/action/vm/share_folders_test.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -106,7 +107,11 @@ def stub_shared_folders(contents)

@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
Expand Down

0 comments on commit 0b02deb

Please sign in to comment.