Fix automount select to accept key/val instead of just val

This commit is contained in:
Mitchell Hashimoto 2011-01-04 20:10:34 -08:00
parent c1e0504c66
commit e0c716e454
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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