allow test to work in cases where you can't create $profile
This commit is contained in:
parent
3b5663ee97
commit
592f897d21
|
@ -269,8 +269,14 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||||
){
|
){
|
||||||
param($switch)
|
param($switch)
|
||||||
|
|
||||||
Get-Content $profile -Raw | Should -Not -BeNullOrEmpty
|
if (Test-Path $profile) {
|
||||||
& pwsh $switch -c exit | Should -BeExactly "profile-loaded"
|
& pwsh $switch -command exit | Should -BeExactly "profile-loaded"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# In CI, may not be able to write to $profile location, so just verify that the switch is accepted
|
||||||
|
# and no error message is in the output
|
||||||
|
& pwsh $switch -command exit *>&1 | Should -BeNullOrEmpty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue