From 9e41bd9a34cf3649f921933d4535aa4c3056023e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 25 Feb 2010 23:57:50 -0800 Subject: [PATCH] Moved the root shared folder to load in the start task. --- lib/vagrant/actions/vm/start.rb | 5 +++++ lib/vagrant/actions/vm/up.rb | 5 ----- test/vagrant/actions/vm/start_test.rb | 7 +++++++ test/vagrant/actions/vm/up_test.rb | 5 ----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/vagrant/actions/vm/start.rb b/lib/vagrant/actions/vm/start.rb index 681adc1d4..1e4038b82 100644 --- a/lib/vagrant/actions/vm/start.rb +++ b/lib/vagrant/actions/vm/start.rb @@ -17,6 +17,11 @@ error end end + def collect_shared_folders + # The root shared folder for the project + ["vagrant-root", Env.root_path, Vagrant.config.vm.project_directory] + end + def boot logger.info "Booting VM..." @runner.vm.start(:headless, true) diff --git a/lib/vagrant/actions/vm/up.rb b/lib/vagrant/actions/vm/up.rb index e95fe44fd..765df5db9 100644 --- a/lib/vagrant/actions/vm/up.rb +++ b/lib/vagrant/actions/vm/up.rb @@ -14,11 +14,6 @@ module Vagrant end end - def collect_shared_folders - # The root shared folder for the project - ["vagrant-root", Env.root_path, Vagrant.config.vm.project_directory] - end - def after_import persist setup_mac_address diff --git a/test/vagrant/actions/vm/start_test.rb b/test/vagrant/actions/vm/start_test.rb index 51f092e78..885a18635 100644 --- a/test/vagrant/actions/vm/start_test.rb +++ b/test/vagrant/actions/vm/start_test.rb @@ -45,4 +45,11 @@ class StartActionTest < Test::Unit::TestCase assert !@action.wait_for_boot(0) end end + + context "callbacks" do + should "setup the root directory shared folder" do + expected = ["vagrant-root", Vagrant::Env.root_path, Vagrant.config.vm.project_directory] + assert_equal expected, @action.collect_shared_folders + end + end end diff --git a/test/vagrant/actions/vm/up_test.rb b/test/vagrant/actions/vm/up_test.rb index 99fe2e2bb..5b2fd3cd7 100644 --- a/test/vagrant/actions/vm/up_test.rb +++ b/test/vagrant/actions/vm/up_test.rb @@ -52,11 +52,6 @@ class UpActionTest < Test::Unit::TestCase @action.expects(:setup_mac_address).once.in_sequence(boot_seq) @action.after_import end - - should "setup the root directory shared folder" do - expected = ["vagrant-root", Vagrant::Env.root_path, Vagrant.config.vm.project_directory] - assert_equal expected, @action.collect_shared_folders - end end context "persisting" do