mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Migration to Pester tests
This commit is contained in:
35
images/win/scripts/Tests/Git.Tests.ps1
Normal file
35
images/win/scripts/Tests/Git.Tests.ps1
Normal file
@@ -0,0 +1,35 @@
|
||||
Describe "Git" {
|
||||
$gitTools = 'bash', 'awk', 'git', 'git-lfs'
|
||||
$gitTestCases = $gitTools | ForEach-Object {
|
||||
@{
|
||||
toolName = $_
|
||||
source = [regex]::Escape("$env:ProgramFiles\Git")
|
||||
}
|
||||
}
|
||||
|
||||
It "Toolname '<toolName>' is installed" -TestCases $gitTestCases {
|
||||
"$toolName --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "ToolName '<toolName>' is located in '<source>'" -TestCases $gitTestCases {
|
||||
(Get-Command -Name $toolName).Source | Should -Match $source
|
||||
}
|
||||
|
||||
It "hub is installed" {
|
||||
"hub --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Git core.symlinks=true option is enabled" {
|
||||
git config core.symlinks | Should -BeExactly true
|
||||
}
|
||||
|
||||
It "GCM_INTERACTIVE environment variable should be equal Never" {
|
||||
$env:GCM_INTERACTIVE | Should -BeExactly Never
|
||||
}
|
||||
}
|
||||
|
||||
Describe "GitVersion" {
|
||||
It "gitversion is installed" {
|
||||
"gitversion /version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user