core: fix some failing Windows tests

This commit is contained in:
Mitchell Hashimoto 2015-11-20 14:54:38 -08:00
parent b6f0b498e4
commit 27412e6ee9
1 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,8 @@ require "tmpdir"
require File.expand_path("../../base", __FILE__) require File.expand_path("../../base", __FILE__)
require "vagrant/util/platform"
describe Vagrant::Machine do describe Vagrant::Machine do
include_context "unit" include_context "unit"
@ -692,14 +694,17 @@ describe Vagrant::Machine do
end end
it "should return the private key in the Vagrantfile if the data dir exists" do 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 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| instance.data_dir.join("private_key").open("w+") do |f|
f.write("hey") f.write("hey")
end end
expect(instance.ssh_info[:private_key_path]).to eql(["/foo"]) expect(instance.ssh_info[:private_key_path]).to eql([path])
end end
context "with no data dir" do context "with no data dir" do