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