mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
allow test to work in cases where you can't create $profile
This commit is contained in:
1 parent
3b5663ee97
commit
592f897d21
1 file changed
+8
-2
@@ -269,8 +269,14 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||
){
|
||||
param($switch)
|
||||
|
||||
Get-Content $profile -Raw | Should -Not -BeNullOrEmpty
|
||||
& pwsh $switch -c exit | Should -BeExactly "profile-loaded"
|
||||
if (Test-Path $profile) {
|
||||
& 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user