parent
c056a86f1f
commit
8b398b66a3
|
@ -101,7 +101,8 @@ module VagrantPlugins
|
|||
# of a hack but is the most portable way I can think of at the moment
|
||||
# to achieve this. Otherwise, Vagrant attempts to share at some crazy
|
||||
# path like /home/vagrant/c:/foo/bar
|
||||
remote_path = File.expand_path(path.gsub(/^[a-zA-Z]:\//, "/"), guest_provisioning_path.gsub(/^[a-zA-Z]:\//, "/"))
|
||||
remote_path = File.expand_path(path.sub(/^[a-zA-Z]:\//, "/"), guest_provisioning_path.sub(/^[a-zA-Z]:\//, "/"))
|
||||
remote_path.sub!(/^[a-zA-Z]:\//, "/")
|
||||
end
|
||||
|
||||
# If we have specified a folder name to append then append it
|
||||
|
|
|
@ -23,12 +23,22 @@ describe VagrantPlugins::Chef::Provisioner::ChefSolo do
|
|||
end
|
||||
|
||||
describe "#expanded_folders" do
|
||||
before { allow(subject).to receive(:windows?).and_return(true) }
|
||||
|
||||
it "handles the default Windows provisioning path" do
|
||||
allow(config).to receive(:provisioning_path).and_return(nil)
|
||||
allow(subject).to receive(:windows?).and_return(true)
|
||||
remote_path = subject.expanded_folders([[:vm, "cookbooks-1"]])[0][2]
|
||||
expect(remote_path).to eq("/vagrant-chef/cookbooks-1")
|
||||
end
|
||||
|
||||
it "removes drive letter prefix from path" do
|
||||
allow(config).to receive(:provisioning_path).and_return(nil)
|
||||
expect(File).to receive(:expand_path).and_return("C:/vagrant-chef/cookbooks-1")
|
||||
result = subject.expanded_folders([[:vm, "cookbooks-1"]])
|
||||
remote_path = result[0][2]
|
||||
expect(remote_path).to eq("/vagrant-chef/cookbooks-1")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "#expanded_folders" do
|
||||
|
|
Loading…
Reference in New Issue