hobo-up now sets up the shared folder

This commit is contained in:
Mitchell Hashimoto 2010-01-31 18:35:35 -08:00
parent 32816419f5
commit 900477d456
2 changed files with 14 additions and 5 deletions

View File

@ -67,14 +67,13 @@ module Hobo
@vm.save(true)
end
# TODO: We need to get the host path.
def setup_shared_folder
HOBO_LOGGER.info "Creating shared folders..."
folder = VirtualBox::SharedFolder.new
folder.name = "project-path"
folder.hostpath = ""
folder.name = "hobo-root-path"
folder.hostpath = Env.root_path
@vm.shared_folders << folder
#vm.save(true)
@vm.save(true)
end
end
end

View File

@ -116,7 +116,17 @@ class VMTest < Test::Unit::TestCase
end
context "setting up the shared folder" do
# TODO: Since the code actually doesn't do anything yet
should "create a shared folder with the root folder for the VM" do
shared_folder = mock("shared_folder")
shared_folder.stubs(:name=)
shared_folder.expects(:hostpath=).with(Hobo::Env.root_path).once
shared_folder_collection = mock("collection")
shared_folder_collection.expects(:<<).with(shared_folder)
VirtualBox::SharedFolder.expects(:new).returns(shared_folder)
@mock_vm.expects(:shared_folders).returns(shared_folder_collection)
@mock_vm.expects(:save).with(true).once
@vm.setup_shared_folder
end
end
end
end