From a48c5281a55495a1c0bff60d74a7d3da7b4c1609 Mon Sep 17 00:00:00 2001 From: Andy Schwartzmeyer Date: Mon, 6 Jun 2016 15:23:03 -0700 Subject: [PATCH] Fix Windows consistency tests Use `USERPROFILE`, not `HOME`. The latter doesn't exist on Windows, and `HOMEPATH` strips the drive. The former provides `C:\Users\`. Fix location tested for JIT cache location on Windows. --- test/powershell/XDGBDS.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/powershell/XDGBDS.Tests.ps1 b/test/powershell/XDGBDS.Tests.ps1 index ac906443f..84a7c054b 100644 --- a/test/powershell/XDGBDS.Tests.ps1 +++ b/test/powershell/XDGBDS.Tests.ps1 @@ -21,7 +21,7 @@ Describe "XDG Base Directory Specification" { Context "Profile" { It "Should not change Windows behavior" -Skip:($IsLinux -or $IsOSX) { - $expected = [IO.Path]::Combine($env:HOME, "Documents", "WindowsPowerShell", $profileName) + $expected = [IO.Path]::Combine($env:USERPROFILE, "Documents", "WindowsPowerShell", $profileName) & $powershell -noprofile `$PROFILE | Should Be $expected } @@ -40,7 +40,7 @@ Describe "XDG Base Directory Specification" { Context "Modules" { It "Should not change Windows behavior" -Skip:($IsLinux -or $IsOSX) { - $expected = [IO.Path]::Combine($env:HOME, "Documents", "WindowsPowerShell", "Modules") + $expected = [IO.Path]::Combine($env:USERPROFILE, "Documents", "WindowsPowerShell", "Modules") $actual = & $powershell -noprofile `$env:PSMODULEPATH # Windows prepends the system path, so the user path is second $actual.split(';')[1] | Should Be $expected @@ -85,7 +85,7 @@ Describe "XDG Base Directory Specification" { Context "Cache" { It "Should not change Windows behavior" -Skip:($IsLinux -or $IsOSX) { - $expected = [IO.Path]::Combine($env:HOME, "Documents", "WindowsPowerShell", "StartupProfileData-NonInteractive") + $expected = [IO.Path]::Combine($env:LOCALAPPDATA, "Microsoft", "Windows", "PowerShell", "StartupProfileData-NonInteractive") Remove-Item -ErrorAction SilentlyContinue $expected & $powershell -noprofile { exit } $expected | Should Exist