Export doesn't continue chain if error occured

This commit is contained in:
Mitchell Hashimoto 2010-07-22 09:02:28 -07:00
parent 940693287d
commit 9a81a1f49a
2 changed files with 15 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module Vagrant
setup_temp_dir
export
@app.call(env)
@app.call(env) if !env.error?
cleanup
end

View File

@ -51,6 +51,20 @@ class ExportVMActionTest < Test::Unit::TestCase
@env.error!(:interrupt)
@instance.call(@env)
end
should "halt the chain if env error when call is reached" do
@internal_vm.stubs(:powered_off?).returns(true)
@instance.expects(:setup_temp_dir).once
@instance.expects(:export).once.with() do
@env.error!(:interrupt)
true
end
@app.expects(:call).with(@env).never
@instance.expects(:cleanup).once
@instance.call(@env)
end
end
context "cleaning up" do