Convert NFS to new Warden style with 'recover' method

This commit is contained in:
Mitchell Hashimoto 2010-08-30 20:09:26 -07:00
parent aa00d15206
commit b72cf4c57c
2 changed files with 8 additions and 15 deletions

View File

@ -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.

View File

@ -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
end
should "not mount folders if an error occured" do context "recovery" do
seq = sequence("seq") should "clear NFS exports" do
@app.expects(:call).in_sequence(seq).with() do @instance.expects(:clear_nfs_exports).with(@env).once
# Use this mark the env as error @instance.recover(@env)
@env.error!(:foo)
true
end
@instance.expects(:clear_nfs_exports).with(@env).in_sequence(seq)
@instance.expects(:mount_folders).never
@instance.call(@env)
end end
end end