From e35e2fbb0442271c18b38599102b43ad923d7ee0 Mon Sep 17 00:00:00 2001 From: John Bender Date: Fri, 12 Mar 2010 01:34:36 -0800 Subject: [PATCH] expand path fix --- lib/vagrant/config.rb | 2 +- test/vagrant/config_test.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index 88cf11b23..c64b25c5f 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -67,7 +67,7 @@ module Vagrant attr_accessor :private_key_path def private_key_path - File.expand_path(@private_key_path) + File.expand_path(@private_key_path, Env.root_path) end end diff --git a/test/vagrant/config_test.rb b/test/vagrant/config_test.rb index 6e9807fed..83509b59b 100644 --- a/test/vagrant/config_test.rb +++ b/test/vagrant/config_test.rb @@ -3,7 +3,8 @@ require File.join(File.dirname(__FILE__), '..', 'test_helper') class ConfigTest < Test::Unit::TestCase context "the ssh config" do should "expand any path when requesting the value" do - File.stubs(:expand_path).with(Vagrant.config.ssh[:private_key_path]).returns('success') + Vagrant::Env.stubs(:root_path).returns('foo') + File.stubs(:expand_path).with(Vagrant.config.ssh[:private_key_path], 'foo').returns('success') assert Vagrant.config.ssh.private_key_path, 'success' end end