If no shared folders existed, don't worry about clearing them
This commit is contained in:
parent
97facb08fd
commit
b13de6a497
|
@ -31,14 +31,16 @@ module Vagrant
|
|||
end
|
||||
|
||||
def clear_shared_folders
|
||||
logger.info "Clearing previously set shared folders..."
|
||||
if runner.vm.shared_folders.length > 0
|
||||
logger.info "Clearing previously set shared folders..."
|
||||
|
||||
folders = @runner.vm.shared_folders.dup
|
||||
folders.each do |shared_folder|
|
||||
shared_folder.destroy
|
||||
folders = @runner.vm.shared_folders.dup
|
||||
folders.each do |shared_folder|
|
||||
shared_folder.destroy
|
||||
end
|
||||
|
||||
@runner.reload!
|
||||
end
|
||||
|
||||
@runner.reload!
|
||||
end
|
||||
|
||||
def create_metadata
|
||||
|
|
|
@ -81,6 +81,12 @@ class SharedFoldersActionTest < Test::Unit::TestCase
|
|||
@runner.expects(:reload!).once.in_sequence(destroy_seq)
|
||||
@action.clear_shared_folders
|
||||
end
|
||||
|
||||
should "do nothing if no shared folders existed" do
|
||||
@shared_folders.clear
|
||||
@runner.expects(:reload!).never
|
||||
@action.clear_shared_folders
|
||||
end
|
||||
end
|
||||
|
||||
context "setting up shared folder metadata" do
|
||||
|
|
Loading…
Reference in New Issue