Fix automount select to accept key/val instead of just val
This commit is contained in:
parent
c1e0504c66
commit
e0c716e454
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue