From 769431ce7c08ec239c3850c23b3c1017ec68dfeb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 18 Jul 2010 08:24:47 -0700 Subject: [PATCH] Boot verifies not erroneous environment before booting --- lib/vagrant/action/vm/boot.rb | 3 +++ test/vagrant/action/vm/boot_test.rb | 8 ++++++++ 2 files changed, 11 insertions(+) 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)