rebased to master and fixed test
This commit is contained in:
parent
99f7b62c83
commit
afd87c908a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue