diff --git a/lib/hobo/vm.rb b/lib/hobo/vm.rb index 4e7e1752c..99d34d255 100644 --- a/lib/hobo/vm.rb +++ b/lib/hobo/vm.rb @@ -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 \ No newline at end of file diff --git a/test/hobo/vm_test.rb b/test/hobo/vm_test.rb index ef15f2c72..995b9eac0 100644 --- a/test/hobo/vm_test.rb +++ b/test/hobo/vm_test.rb @@ -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