diff --git a/test/unit/plugins/synced_folders/rsync/helper_test.rb b/test/unit/plugins/synced_folders/rsync/helper_test.rb index 28e2b58eb..0230bf343 100644 --- a/test/unit/plugins/synced_folders/rsync/helper_test.rb +++ b/test/unit/plugins/synced_folders/rsync/helper_test.rb @@ -60,7 +60,7 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do Vagrant::Util::Platform.should_receive(:cygwin_windows_path).and_return("foo") Vagrant::Util::Subprocess.should_receive(:execute).with do |*args| - expect(args[args.length - 3]).to eql("foo") + expect(args[args.length - 3]).to eql("foo/") end subject.rsync_single(machine, ssh_info, opts) @@ -80,7 +80,8 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do opts[:guestpath] = "/bar" Vagrant::Util::Subprocess.should_receive(:execute).with do |*args| - expect(args[args.length - 3]).to eql(Vagrant::Util::Platform.fs_real_path("/foo").to_s) + expected = Vagrant::Util::Platform.fs_real_path("/foo").to_s + expect(args[args.length - 3]).to eql("#{expected}/") expect(args[args.length - 2]).to include("/bar") end @@ -94,7 +95,7 @@ describe VagrantPlugins::SyncedFolderRSync::RsyncHelper do hostpath_expanded = File.expand_path(opts[:hostpath], machine.env.root_path) Vagrant::Util::Subprocess.should_receive(:execute).with do |*args| - expect(args[args.length - 3]).to eql(hostpath_expanded) + expect(args[args.length - 3]).to eql("#{hostpath_expanded}/") expect(args[args.length - 2]).to include("/bar") end diff --git a/test/unit/support/shared/virtualbox_context.rb b/test/unit/support/shared/virtualbox_context.rb index 6a13f58bc..13f3d16bc 100644 --- a/test/unit/support/shared/virtualbox_context.rb +++ b/test/unit/support/shared/virtualbox_context.rb @@ -1,4 +1,6 @@ shared_context "virtualbox" do + include_context "unit" + let(:vbox_context) { true } let(:uuid) { "1234-abcd-5678-efgh" } let(:vbox_version) { "4.3.4" } @@ -27,4 +29,11 @@ shared_context "virtualbox" do with("VBoxManage", "showvminfo", kind_of(String), kind_of(Hash)). and_return(subprocess_result(exit_code: 0)) end + + around do |example| + # On Windows, we don't want to accidentally call the actual VirtualBox + with_temp_env("VBOX_INSTALL_PATH" => nil) do + example.run + end + end end