diff --git a/lib/vagrant/action/vm/boot.rb b/lib/vagrant/action/vm/boot.rb index 383913e8b..40d1cc2f9 100644 --- a/lib/vagrant/action/vm/boot.rb +++ b/lib/vagrant/action/vm/boot.rb @@ -8,6 +8,9 @@ module Vagrant end def call(env) + # Do nothing if the environment is erroneous + return if env.error? + @env = env # Start up the VM and wait for it to boot. diff --git a/test/vagrant/action/vm/boot_test.rb b/test/vagrant/action/vm/boot_test.rb index dddcd3c83..a486fa6df 100644 --- a/test/vagrant/action/vm/boot_test.rb +++ b/test/vagrant/action/vm/boot_test.rb @@ -16,6 +16,14 @@ class BootVMActionTest < Test::Unit::TestCase end context "calling" do + should "do nothing if environment is erroneous" do + @env.error!(:foo) + @instance.expects(:boot).never + @app.expects(:call).never + + @instance.call(@env) + end + should "run the proper methods on success" do boot_seq = sequence("boot_seq") @instance.expects(:boot).in_sequence(boot_seq)