Convert NFS to new Warden style with 'recover' method
This commit is contained in:
parent
aa00d15206
commit
b72cf4c57c
|
@ -40,9 +40,10 @@ module Vagrant
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
||||||
mount_folders if !folders.empty?
|
mount_folders if !folders.empty?
|
||||||
|
end
|
||||||
|
|
||||||
# TODO: Make recover method
|
def recover(env)
|
||||||
clear_nfs_exports(env) if env.error?
|
clear_nfs_exports(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the folders which are to be synced via NFS.
|
# Returns the folders which are to be synced via NFS.
|
||||||
|
|
|
@ -65,20 +65,12 @@ class NFSVMActionTest < Test::Unit::TestCase
|
||||||
@instance.expects(:mount_folders).never
|
@instance.expects(:mount_folders).never
|
||||||
@instance.call(@env)
|
@instance.call(@env)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not mount folders if an error occured" do
|
|
||||||
seq = sequence("seq")
|
|
||||||
@app.expects(:call).in_sequence(seq).with() do
|
|
||||||
# Use this mark the env as error
|
|
||||||
@env.error!(:foo)
|
|
||||||
|
|
||||||
true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@instance.expects(:clear_nfs_exports).with(@env).in_sequence(seq)
|
context "recovery" do
|
||||||
|
should "clear NFS exports" do
|
||||||
@instance.expects(:mount_folders).never
|
@instance.expects(:clear_nfs_exports).with(@env).once
|
||||||
@instance.call(@env)
|
@instance.recover(@env)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue