Only mount and do unison setup in the absense of error environments

This commit is contained in:
Mitchell Hashimoto 2010-07-05 02:33:44 +02:00
parent 73a3723608
commit ae750288ed
2 changed files with 19 additions and 2 deletions

View File

@ -15,9 +15,13 @@ module Vagrant
@app.call(env) @app.call(env)
if !env.error?
# Only mount and setup shared folders in the absense of an
# error
mount_shared_folders mount_shared_folders
setup_unison setup_unison
end end
end
# This method returns an actual list of VirtualBox shared # This method returns an actual list of VirtualBox shared
# folders to create and their proper path. # folders to create and their proper path.

View File

@ -46,6 +46,19 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
@instance.call(@env) @instance.call(@env)
end end
should "run only the metadata actions if erroneous environment" do
@env.error!(:foo)
before_seq = sequence("before")
@instance.expects(:clear_shared_folders).once.in_sequence(before_seq)
@instance.expects(:create_metadata).once.in_sequence(before_seq)
@app.expects(:call).with(@env).in_sequence(before_seq)
@instance.expects(:mount_shared_folders).never
@instance.expects(:setup_unison).never
@instance.call(@env)
end
end end
context "collecting shared folders" do context "collecting shared folders" do