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)
|
||||
|
||||
mount_folders if !folders.empty?
|
||||
end
|
||||
|
||||
# TODO: Make recover method
|
||||
clear_nfs_exports(env) if env.error?
|
||||
def recover(env)
|
||||
clear_nfs_exports(env)
|
||||
end
|
||||
|
||||
# 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.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
|
||||
|
||||
@instance.expects(:clear_nfs_exports).with(@env).in_sequence(seq)
|
||||
|
||||
@instance.expects(:mount_folders).never
|
||||
@instance.call(@env)
|
||||
context "recovery" do
|
||||
should "clear NFS exports" do
|
||||
@instance.expects(:clear_nfs_exports).with(@env).once
|
||||
@instance.recover(@env)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue