Skip tests which can't be run on Travis OS X
These should be marked as `-Pending` but Pester doesn't accept both `-Skip` and `-Pending` parameters, so they had to be combined to support skipping on Windows.
This commit is contained in:
parent
0e10a51802
commit
4b0c916646
@ -25,12 +25,12 @@ Describe "XDG Base Directory Specification" {
|
||||
& $powershell -noprofile `$PROFILE | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should start with the default profile on Linux" -Skip:($IsWindows) {
|
||||
It "Should start with the default profile on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$expected = [IO.Path]::Combine($env:HOME, ".config", "powershell", $profileName)
|
||||
& $powershell -noprofile `$PROFILE | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should respect XDG_CONFIG_HOME on Linux" -Skip:$IsWindows {
|
||||
It "Should respect XDG_CONFIG_HOME on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$env:XDG_CONFIG_HOME = $TestDrive
|
||||
$expected = [IO.Path]::Combine($TestDrive, "powershell", $profileName)
|
||||
& $powershell -noprofile `$PROFILE | Should Be $expected
|
||||
@ -42,24 +42,24 @@ Describe "XDG Base Directory Specification" {
|
||||
It "Should not change Windows behavior" -Skip:($IsLinux -or $IsOSX) {
|
||||
$expected = [IO.Path]::Combine($env:HOME, "Documents", "WindowsPowerShell", "Modules")
|
||||
$actual = & $powershell -noprofile `$env:PSMODULEPATH
|
||||
$actual.split(';')[0] | Should Be $expected
|
||||
# Windows prepends the system path, so the user path is second
|
||||
$actual.split(';')[1] | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should start with the default module path on Linux" -Skip:$IsWindows {
|
||||
It "Should start with the default module path on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$env:PSMODULEPATH = "" # must not be sent to child process
|
||||
$expected = [IO.Path]::Combine($env:HOME, ".local", "share", "powershell", "Modules")
|
||||
$actual = & $powershell -noprofile `$env:PSMODULEPATH
|
||||
$actual.split(';')[0] | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should respect XDG_DATA_HOME on Linux" -Skip:$IsWindows {
|
||||
It "Should respect XDG_DATA_HOME on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$env:PSMODULEPATH = "" # must not be sent to child process
|
||||
$env:XDG_DATA_HOME = $TestDrive
|
||||
$expected = [IO.Path]::Combine($TestDrive, "powershell", "Modules")
|
||||
$actual = & $powershell -noprofile `$env:PSMODULEPATH
|
||||
$actual.split(';')[0] | Should Be $expected
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Context "PSReadLine" {
|
||||
@ -69,12 +69,12 @@ Describe "XDG Base Directory Specification" {
|
||||
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should start with the default history save path on Linux" -Skip:$IsWindows {
|
||||
It "Should start with the default history save path on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$expected = [IO.Path]::Combine($env:HOME, ".local", "share", "powershell", "PSReadLine", "ConsoleHost_history.txt")
|
||||
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should respect XDG_DATA_HOME on Linux" -Skip:$IsWindows {
|
||||
It "Should respect XDG_DATA_HOME on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$env:XDG_DATA_HOME = $TestDrive
|
||||
$expected = [IO.Path]::Combine($TestDrive, "powershell", "PSReadLine", "ConsoleHost_history.txt")
|
||||
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should Be $expected
|
||||
@ -91,14 +91,14 @@ Describe "XDG Base Directory Specification" {
|
||||
$expected | Should Exist
|
||||
}
|
||||
|
||||
It "Should start with the default StartupProfileData on Linux" -Skip:$IsWindows {
|
||||
It "Should start with the default StartupProfileData on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$expected = [IO.Path]::Combine($env:HOME, ".cache", "powershell", "StartupProfileData-NonInteractive")
|
||||
Remove-Item -ErrorAction SilentlyContinue $expected
|
||||
& $powershell -noprofile { exit }
|
||||
$expected | Should Exist
|
||||
}
|
||||
|
||||
It "Should respect XDG_CACHE_HOME on Linux" -Skip:$IsWindows {
|
||||
It "Should respect XDG_CACHE_HOME on Linux" -Skip:($IsWindows -or ($env:TRAVIS_OS_NAME -eq "osx")) {
|
||||
$env:XDG_CACHE_HOME = $TestDrive
|
||||
$expected = [IO.Path]::Combine($TestDrive, "powershell", "StartupProfileData-NonInteractive")
|
||||
Remove-Item -ErrorAction SilentlyContinue $expected
|
||||
|
Loading…
Reference in New Issue
Block a user