Add windows platform test for ensuring tmp file does not exist

This commit is contained in:
Brian Cain 2019-02-22 12:44:46 -08:00
parent 45ca16ffd5
commit 401a571642
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 13 additions and 0 deletions

View File

@ -295,6 +295,19 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do
expect(FileUtils).to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345").and_return(true)
subject.rsync_single(machine, ssh_info, opts)
end
it "does not create tmp dir on windows platforms" do
allow(Vagrant::Util::Platform).to receive(:windows?).and_return(true)
allow(Dir).to receive(:mktmpdir).with("vagrant-rsync-").
and_return("/tmp/vagrant-rsync-12345")
expect(Vagrant::Util::Subprocess).to receive(:execute).with(any_args) { |*args|
expect(args).not_to include("ControlPath=/tmp/vagrant-rsync-12345")
}.and_return(result)
expect(FileUtils).not_to receive(:remove_entry_secure).with("/tmp/vagrant-rsync-12345")
subject.rsync_single(machine, ssh_info, opts)
end
end
end