rebased to master and fixed test
This commit is contained in:
parent
99f7b62c83
commit
afd87c908a
|
@ -64,15 +64,6 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
Busy.busy(int_callback) { callable.call(action_environment) }
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -37,14 +37,11 @@ class ImportVMActionTest < Test::Unit::TestCase
|
||||||
assert @env.error?
|
assert @env.error?
|
||||||
end
|
end
|
||||||
|
|
||||||
should "run the destroy action if interrupted" do
|
should "run the destroy action on rescue" do
|
||||||
VirtualBox::VM.stubs(:import).returns(mock("vm"))
|
env = mock("env")
|
||||||
@app.expects(:call).once.with() do |env|
|
destroy = mock("destory")
|
||||||
assert_equal @env, env
|
env.expects(:[]).with("actions").returns(destroy)
|
||||||
@env.error!(:interrupt)
|
destroy.expects(:run).with(:destroy)
|
||||||
end
|
@instance.rescue(env)
|
||||||
@env.env.actions.expects(:run).with(:destroy).once
|
|
||||||
|
|
||||||
@instance.call(@env)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue