From 27412e6ee97c88a928d9c9e33c3258e34f9bb2b7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 20 Nov 2015 14:54:38 -0800 Subject: [PATCH] core: fix some failing Windows tests --- test/unit/vagrant/machine_test.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/unit/vagrant/machine_test.rb b/test/unit/vagrant/machine_test.rb index cb47a3ef8..f3ec97d4a 100644 --- a/test/unit/vagrant/machine_test.rb +++ b/test/unit/vagrant/machine_test.rb @@ -3,6 +3,8 @@ require "tmpdir" require File.expand_path("../../base", __FILE__) +require "vagrant/util/platform" + describe Vagrant::Machine do include_context "unit" @@ -692,14 +694,17 @@ describe Vagrant::Machine do end it "should return the private key in the Vagrantfile if the data dir exists" do + path = "/foo" + path = "C:/foo" if Vagrant::Util::Platform.windows? + provider_ssh_info[:private_key_path] = nil - instance.config.ssh.private_key_path = "/foo" + instance.config.ssh.private_key_path = path instance.data_dir.join("private_key").open("w+") do |f| f.write("hey") end - expect(instance.ssh_info[:private_key_path]).to eql(["/foo"]) + expect(instance.ssh_info[:private_key_path]).to eql([path]) end context "with no data dir" do