diff --git a/lib/vagrant/env.rb b/lib/vagrant/env.rb index f94bd7a3c..1b94363ae 100644 --- a/lib/vagrant/env.rb +++ b/lib/vagrant/env.rb @@ -114,7 +114,7 @@ msg end def load_root_path!(path=nil) - path = Pathname.new(File.expand_path(path || Dir.pwd)) + path = Pathname.new(File.expand_path(path || Dir.pwd)) # Stop if we're at the root. return false if path.root? diff --git a/test/vagrant/env_test.rb b/test/vagrant/env_test.rb index 909b2ba1b..3ca15c6a6 100644 --- a/test/vagrant/env_test.rb +++ b/test/vagrant/env_test.rb @@ -246,9 +246,13 @@ class EnvTest < Test::Unit::TestCase end should "return false if not found on windows-style root" do - # Note the escaped back slash - path = Pathname.new("C:\\") - assert !Vagrant::Env.load_root_path!(path) + # TODO: Is there _any_ way to test this on unix machines? The + # expand path doesn't work [properly for the test] on unix machines. + if RUBY_PLATFORM.downcase.include?("mswin") + # Note the escaped back slash + path = Pathname.new("C:\\") + assert !Vagrant::Env.load_root_path!(path) + end end should "should set the path for the rootfile" do