diff --git a/lib/vagrant/actions/vm/start.rb b/lib/vagrant/actions/vm/start.rb index 5e7fc1a66..ba4e6856a 100644 --- a/lib/vagrant/actions/vm/start.rb +++ b/lib/vagrant/actions/vm/start.rb @@ -6,6 +6,7 @@ module Vagrant # Start is a "meta-action" so it really just queues up a bunch # of other actions in its place: steps = [ForwardPorts, SharedFolders, Boot] + steps.unshift(Customize) unless @runner.vm.saved? steps.each do |action_klass| @runner.add_action(action_klass) diff --git a/test/vagrant/actions/vm/start_test.rb b/test/vagrant/actions/vm/start_test.rb index d054a15f2..f7d159e0b 100644 --- a/test/vagrant/actions/vm/start_test.rb +++ b/test/vagrant/actions/vm/start_test.rb @@ -8,6 +8,7 @@ class StartActionTest < Test::Unit::TestCase context "sub-actions" do setup do + @vm.stubs(:saved?).returns(true) File.stubs(:file?).returns(true) File.stubs(:exist?).returns(true) @default_order = [Vagrant::Actions::VM::ForwardPorts, Vagrant::Actions::VM::SharedFolders, Vagrant::Actions::VM::Boot] @@ -24,5 +25,12 @@ class StartActionTest < Test::Unit::TestCase setup_action_expectations @action.prepare end + + should "add customize to the beginning if its not saved" do + @vm.expects(:saved?).returns(false) + @default_order.unshift(Vagrant::Actions::VM::Customize) + setup_action_expectations + @action.prepare + end end end