From f2242662f8e7586882fea5140d5090f532b4258d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 21 Jul 2010 15:50:27 -0700 Subject: [PATCH] Don't return when finding disabled shared folder, continue to include others --- lib/vagrant/action/vm/share_folders.rb | 2 +- test/vagrant/action/vm/share_folders_test.rb | 5 ++++- vagrant.gemspec | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/action/vm/share_folders.rb b/lib/vagrant/action/vm/share_folders.rb index 90871c02f..56c249c1b 100644 --- a/lib/vagrant/action/vm/share_folders.rb +++ b/lib/vagrant/action/vm/share_folders.rb @@ -32,7 +32,7 @@ module Vagrant @env.env.config.vm.shared_folders.inject({}) do |acc, data| key, value = data - return acc if value[:disabled] + next acc if value[:disabled] # This to prevent overwriting the actual shared folders data value = value.dup diff --git a/test/vagrant/action/vm/share_folders_test.rb b/test/vagrant/action/vm/share_folders_test.rb index d2deed301..e147b079f 100644 --- a/test/vagrant/action/vm/share_folders_test.rb +++ b/test/vagrant/action/vm/share_folders_test.rb @@ -87,10 +87,13 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase should "ignore disabled shared folders" do stub_shared_folders do |config| + config.vm.share_folder("v-foo", "/foo", "/foo") config.vm.share_folder("v-root", "/vagrant", ".", :disabled => true) + config.vm.share_folder("v-bar", "/bar", "/bar") end - assert @instance.shared_folders.empty? + assert_equal 2, @instance.shared_folders.length + assert_equal %W[v-bar v-foo], @instance.shared_folders.keys.sort end should "append sync suffix if sync enabled to a folder" do diff --git a/vagrant.gemspec b/vagrant.gemspec index 6459e46a4..030c5463b 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= s.authors = ["Mitchell Hashimoto", "John Bender"] - s.date = %q{2010-07-20} + s.date = %q{2010-07-21} s.default_executable = %q{vagrant} s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.} s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]