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