From afd87c908ac8e81f33e4cb94c172b4f3f971a7e0 Mon Sep 17 00:00:00 2001 From: John Bender Date: Thu, 29 Jul 2010 20:50:20 -0700 Subject: [PATCH] rebased to master and fixed test --- lib/vagrant/action.rb | 9 --------- test/vagrant/action/vm/import_test.rb | 15 ++++++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/lib/vagrant/action.rb b/lib/vagrant/action.rb index 1917d9489..90f284ef8 100644 --- a/lib/vagrant/action.rb +++ b/lib/vagrant/action.rb @@ -64,15 +64,6 @@ module Vagrant end Busy.busy(int_callback) { callable.call(action_environment) } - exit if action_environment.interrupted? - - if action_environment.error? - # Erroneous environment resulted. Properly display error - # message. - key, options = action_environment.error - error_and_exit(key, options) - return false - end end end end diff --git a/test/vagrant/action/vm/import_test.rb b/test/vagrant/action/vm/import_test.rb index c3878c7aa..cfc903647 100644 --- a/test/vagrant/action/vm/import_test.rb +++ b/test/vagrant/action/vm/import_test.rb @@ -37,14 +37,11 @@ class ImportVMActionTest < Test::Unit::TestCase assert @env.error? end - should "run the destroy action if interrupted" do - VirtualBox::VM.stubs(:import).returns(mock("vm")) - @app.expects(:call).once.with() do |env| - assert_equal @env, env - @env.error!(:interrupt) - end - @env.env.actions.expects(:run).with(:destroy).once - - @instance.call(@env) + should "run the destroy action on rescue" do + env = mock("env") + destroy = mock("destory") + env.expects(:[]).with("actions").returns(destroy) + destroy.expects(:run).with(:destroy) + @instance.rescue(env) end end