2021-02-01 06:03:49 -08:00
|
|
|
Describe "Nginx" {
|
|
|
|
|
Context "Path" {
|
|
|
|
|
It "Nginx" {
|
2021-08-27 09:38:18 +03:00
|
|
|
$nginxPath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\nginx*).Name) "nginx"
|
2021-02-01 06:03:49 -08:00
|
|
|
"$nginxPath -v" | Should -ReturnZeroExitCode
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Context "Service" {
|
|
|
|
|
$nginxService = Get-Service -Name nginx
|
|
|
|
|
$nginxServiceTests = @{
|
|
|
|
|
Name = $nginxService.Name
|
|
|
|
|
Status = $nginxService.Status
|
|
|
|
|
StartType = $nginxService.StartType
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "<Name> service is stopped" -TestCases $nginxServiceTests {
|
|
|
|
|
$Status | Should -Be "Stopped"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "<Name> service is disabled" -TestCases $nginxServiceTests {
|
|
|
|
|
$StartType | Should -Be "Disabled"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|