Export doesn't continue chain if error occured
This commit is contained in:
parent
940693287d
commit
9a81a1f49a
|
@ -18,7 +18,7 @@ module Vagrant
|
||||||
setup_temp_dir
|
setup_temp_dir
|
||||||
export
|
export
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env) if !env.error?
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,6 +51,20 @@ class ExportVMActionTest < Test::Unit::TestCase
|
||||||
@env.error!(:interrupt)
|
@env.error!(:interrupt)
|
||||||
@instance.call(@env)
|
@instance.call(@env)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "cleaning up" do
|
context "cleaning up" do
|
||||||
|
|
Loading…
Reference in New Issue