core: Fix tests, which found broken logic in synced folders

This commit is contained in:
Mitchell Hashimoto 2014-04-11 16:28:38 -07:00
parent 2b47478d6a
commit 2cb6a21a5a
2 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,11 @@ module Vagrant
fs.each do |id, data| fs.each do |id, data|
data[:hostpath] = File.expand_path( data[:hostpath] = File.expand_path(
data[:hostpath], env[:root_path]) data[:hostpath], env[:root_path])
data[:hostpath] = File.realpath(data[:hostpath])
# Expand the symlink if this is a path that exists
if File.file?(data[:hostpath])
data[:hostpath] = File.realpath(data[:hostpath])
end
# Create the hostpath if it doesn't exist and we've been told to # Create the hostpath if it doesn't exist and we've been told to
if !File.directory?(data[:hostpath]) && data[:create] if !File.directory?(data[:hostpath]) && data[:create]

View File

@ -4,6 +4,7 @@ require "tmpdir"
require File.expand_path("../../../../base", __FILE__) require File.expand_path("../../../../base", __FILE__)
describe Vagrant::Action::Builtin::SyncedFolders do describe Vagrant::Action::Builtin::SyncedFolders do
include_context "unit"
include_context "synced folder actions" include_context "synced folder actions"
let(:app) { lambda { |env| } } let(:app) { lambda { |env| } }