From 401a571642e2d5355fa7b9e2b7c2b19e21258884 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 22 Feb 2019 12:44:46 -0800 Subject: [PATCH] Add windows platform test for ensuring tmp file does not exist --- .../plugins/synced_folders/rsync/helper_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/plugins/synced_folders/rsync/helper_test.rb b/test/unit/plugins/synced_folders/rsync/helper_test.rb index 9300b9458..860ea0403 100644 --- a/test/unit/plugins/synced_folders/rsync/helper_test.rb +++ b/test/unit/plugins/synced_folders/rsync/helper_test.rb @@ -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