From e0c716e454bd7638a38b28208a71e16a1488147c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 4 Jan 2011 20:10:34 -0800 Subject: [PATCH] Fix automount select to accept key/val instead of just val --- lib/vagrant/action/vm/nfs.rb | 2 +- test/vagrant/action/vm/nfs_test.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/action/vm/nfs.rb b/lib/vagrant/action/vm/nfs.rb index 020036b93..e543b8556 100644 --- a/lib/vagrant/action/vm/nfs.rb +++ b/lib/vagrant/action/vm/nfs.rb @@ -114,7 +114,7 @@ module Vagrant @env.ui.info I18n.t("vagrant.actions.vm.nfs.mounting") # Only mount the folders which have a guest path specified - am_folders = folders.select { |folder| folder[:guestpath] } + am_folders = folders.select { |name, folder| folder[:guestpath] } @env["vm"].system.mount_nfs(host_ip, am_folders) end diff --git a/test/vagrant/action/vm/nfs_test.rb b/test/vagrant/action/vm/nfs_test.rb index b6f5efcee..5b0374846 100644 --- a/test/vagrant/action/vm/nfs_test.rb +++ b/test/vagrant/action/vm/nfs_test.rb @@ -160,7 +160,7 @@ class NFSVMActionTest < Test::Unit::TestCase context "mounting folders" do setup do @instance.stubs(:host_ip).returns("foo") - @instance.stubs(:folders).returns([{:guestpath => "foo"}]) + @instance.stubs(:folders).returns({ "v-data" => {:guestpath => "foo"}}) end should "mount the folders on the system" do @@ -169,8 +169,8 @@ class NFSVMActionTest < Test::Unit::TestCase end should "not mount folders which have no guest path" do - @instance.stubs(:folders).returns([{}]) - @vm.system.expects(:mount_nfs).with(@instance.host_ip, []) + @instance.stubs(:folders).returns({ "v-data" => {}}) + @vm.system.expects(:mount_nfs).with(@instance.host_ip, {}) @instance.mount_folders end end