From 88fedb419e171dc1b8d819b32a9647ae9e61278a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 7 Sep 2010 00:28:21 -0700 Subject: [PATCH] Update Environment#dotfile_path to take advantage of new Pathname object --- lib/vagrant/environment.rb | 2 +- test/vagrant/environment_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 63a7eb4a3..d6149cbdb 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -55,7 +55,7 @@ module Vagrant # The path to the `dotfile`, which contains the persisted UUID of # the VM if it exists. def dotfile_path - root_path ? File.join(root_path, config.vagrant.dotfile_name) : nil + root_path.join(config.vagrant.dotfile_name) rescue nil end # The path to the home directory, which is usually in `~/.vagrant/~ diff --git a/test/vagrant/environment_test.rb b/test/vagrant/environment_test.rb index a413c055d..4704f669f 100644 --- a/test/vagrant/environment_test.rb +++ b/test/vagrant/environment_test.rb @@ -54,7 +54,7 @@ class EnvironmentTest < Test::Unit::TestCase context "dotfile path" do should "build up the dotfile out of the root path and the dotfile name" do - assert_equal File.join(@env.root_path, @env.config.vagrant.dotfile_name), @env.dotfile_path + assert_equal @env.root_path.join(@env.config.vagrant.dotfile_name), @env.dotfile_path end end