Skip to content

Commit e86fea6

Browse files
bergmeisterdaxian-dbw
authored andcommitted
Upgrade tests in test\powershell\Host folder to PesterV4 syntax (PowerShell#6250)
1 parent acb52b3 commit e86fea6

7 files changed

Lines changed: 292 additions & 293 deletions

File tree

test/powershell/Host/Base-Directory.Tests.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,24 @@ Describe "Configuration file locations" -tags "CI","Slow" {
4040
}
4141

4242
It @ItArgs "Profile location should be correct" {
43-
& $powershell -noprofile -c `$PROFILE | Should Be $expectedProfile
43+
& $powershell -noprofile -c `$PROFILE | Should -Be $expectedProfile
4444
}
4545

4646
It @ItArgs "PSModulePath should contain the correct path" {
4747
$env:PSModulePath = ""
4848
$actual = & $powershell -noprofile -c `$env:PSModulePath
49-
$actual | Should Match ([regex]::Escape($expectedModule))
49+
$actual | Should -Match ([regex]::Escape($expectedModule))
5050
}
5151

5252
It @ItArgs "PSReadLine history save location should be correct" {
53-
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should Be $expectedReadline
53+
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should -Be $expectedReadline
5454
}
5555

5656
# This feature (and thus test) has been disabled because of the AssemblyLoadContext scenario
5757
It "JIT cache should be created correctly" -Skip {
5858
Remove-Item -ErrorAction SilentlyContinue $expectedCache
5959
& $powershell -noprofile { exit }
60-
$expectedCache | Should Exist
60+
$expectedCache | Should -Exist
6161
}
6262

6363
# The ModuleAnalysisCache cannot be forced to exist, thus we cannot test it
@@ -90,21 +90,21 @@ Describe "Configuration file locations" -tags "CI","Slow" {
9090
It @ItArgs "Profile should respect XDG_CONFIG_HOME" {
9191
$env:XDG_CONFIG_HOME = $TestDrive
9292
$expected = [IO.Path]::Combine($TestDrive, "powershell", $profileName)
93-
& $powershell -noprofile -c `$PROFILE | Should Be $expected
93+
& $powershell -noprofile -c `$PROFILE | Should -Be $expected
9494
}
9595

9696
It @ItArgs "PSModulePath should respect XDG_DATA_HOME" {
9797
$env:PSModulePath = ""
9898
$env:XDG_DATA_HOME = $TestDrive
9999
$expected = [IO.Path]::Combine($TestDrive, "powershell", "Modules")
100100
$actual = & $powershell -noprofile -c `$env:PSModulePath
101-
$actual | Should Match $expected
101+
$actual | Should -Match $expected
102102
}
103103

104104
It @ItArgs "PSReadLine history should respect XDG_DATA_HOME" {
105105
$env:XDG_DATA_HOME = $TestDrive
106106
$expected = [IO.Path]::Combine($TestDrive, "powershell", "PSReadLine", "ConsoleHost_history.txt")
107-
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should Be $expected
107+
& $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should -Be $expected
108108
}
109109

110110
# This feature (and thus test) has been disabled because of the AssemblyLoadContext scenario
@@ -113,7 +113,7 @@ Describe "Configuration file locations" -tags "CI","Slow" {
113113
$expected = [IO.Path]::Combine($TestDrive, "powershell", "StartupProfileData-NonInteractive")
114114
Remove-Item -ErrorAction SilentlyContinue $expected
115115
& $powershell -noprofile { exit }
116-
$expected | Should Exist
116+
$expected | Should -Exist
117117
}
118118
}
119119
}
@@ -137,6 +137,6 @@ Describe "Working directory on startup" -Tag "CI" {
137137
} else {
138138
$expectedPath = $testPath.FullName
139139
}
140-
& $powershell -noprofile -c { $PWD.Path } | Should BeExactly $expectedPath
140+
& $powershell -noprofile -c { $PWD.Path } | Should -BeExactly $expectedPath
141141
}
142142
}

0 commit comments

Comments
 (0)