From 4c6f8d2b52fa0731819c395d32c631c020ad49c6 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 2 Nov 2011 21:38:48 -0700 Subject: [PATCH] Setup isolated environment to setup a custom HOME directory as well --- test/acceptance/helpers/isolated_environment.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/acceptance/helpers/isolated_environment.rb b/test/acceptance/helpers/isolated_environment.rb index a3a58753e..9281c16a5 100644 --- a/test/acceptance/helpers/isolated_environment.rb +++ b/test/acceptance/helpers/isolated_environment.rb @@ -1,3 +1,5 @@ +require "fileutils" + require "log4r" require "posix-spawn" @@ -27,6 +29,15 @@ module Acceptance # Create a temporary directory for our work @tempdir = Tempdir.new("vagrant") @logger.info("Initialize isolated environment: #{@tempdir.path}") + + # Setup the home and working directories + @homedir = File.join(@tempdir.path, "home") + @workdir = File.join(@tempdir.path, "work") + + FileUtils.mkdir(@homedir) + FileUtils.mkdir(@workdir) + + @env["HOME"] = @homedir end # Executes a command in the context of this isolated environment.