rebased to master and fixed test

This commit is contained in:
John Bender 2010-07-29 20:50:20 -07:00
parent 99f7b62c83
commit afd87c908a
2 changed files with 6 additions and 18 deletions

View File

@ -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

View File

@ -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