diff --git a/images/win/scripts/Tests/Browsers.Tests.ps1 b/images/win/scripts/Tests/Browsers.Tests.ps1 index 55bae00f..6a50af09 100644 --- a/images/win/scripts/Tests/Browsers.Tests.ps1 +++ b/images/win/scripts/Tests/Browsers.Tests.ps1 @@ -18,7 +18,7 @@ Describe "Chrome" { Context "Browser" { $chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe" - It "$edgeRegPath registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} { + It "Chrome registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} { $chromeRegPath | Should -Exist } @@ -67,7 +67,7 @@ Describe "Edge" { Context "Browser" { $edgeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe" - It "$edgeRegPath registry path exists" -TestCases @{edgeRegPath = $edgeRegPath} { + It "Edge registry path exists" -TestCases @{edgeRegPath = $edgeRegPath} { $edgeRegPath | Should -Exist } @@ -102,7 +102,7 @@ Describe "Firefox" { Context "Browser" { $firefoxRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe" - It "$firefoxRegPath registry path exists" -TestCases @{firefoxRegPath = $firefoxRegPath} { + It "Firefox registry path exists" -TestCases @{firefoxRegPath = $firefoxRegPath} { $firefoxRegPath | Should -Exist } @@ -125,7 +125,7 @@ Describe "Internet Explorer" { $env:IEWebDriver | Should -Exist } - It "iedriverserver.exe is intalled" { + It "iedriverserver.exe is installed" { "$env:IEWebDriver\IEDriverServer.exe --version" | Should -ReturnZeroExitCode } diff --git a/images/win/scripts/Tests/Git.Tests.ps1 b/images/win/scripts/Tests/Git.Tests.ps1 index a2db12d0..88c6f039 100644 --- a/images/win/scripts/Tests/Git.Tests.ps1 +++ b/images/win/scripts/Tests/Git.Tests.ps1 @@ -15,7 +15,7 @@ Describe "Git" { (Get-Command -Name $toolName).Source | Should -Match $source } - It "hub is installed" { + It "ToolName 'hub' is installed" { "hub --version" | Should -ReturnZeroExitCode } diff --git a/images/win/scripts/Tests/Haskell.Tests.ps1 b/images/win/scripts/Tests/Haskell.Tests.ps1 index b421b022..99780a55 100644 --- a/images/win/scripts/Tests/Haskell.Tests.ps1 +++ b/images/win/scripts/Tests/Haskell.Tests.ps1 @@ -1,33 +1,30 @@ Describe "Haskell" { - It "ghc" { - "ghc --version" | Should -ReturnZeroExitCode - } - - It "cabal" { - "cabal --version" | Should -ReturnZeroExitCode - } - $chocoPackagesPath = Join-Path $env:ChocolateyInstall "lib" [array]$ghcVersionList = Get-ChildItem -Path $chocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") } $ghcCount = $ghcVersionList.Count + $defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} | Select-Object -Last 1 + + $ghcTestCases = $ghcVersionList | ForEach-Object { + $ghcVersion = $_ + @{ + ghcVersion = $ghcVersion + binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe" + } + } It "Accurate 3 versions of GHC are installed" -TestCases @{ghcCount = $ghcCount} { $ghcCount | Should -BeExactly 3 } - $ghcTestCases = $ghcVersionList | ForEach-Object { - @{ - ghcVersion = $_ - } - } - - It " is installed" -TestCases $ghcTestCases { - $binGhcPath = Join-Path $env:ChocolateyInstall "lib\ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe" + It "GHC is installed" -TestCases $ghcTestCases { & $binGhcPath --version | Should -Match $ghcVersion } - It "Default version of GHC should be the latest installed" -TestCases @{ghcVersionList = $ghcVersionList} { - $defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} |Select-Object -Last 1 + It "GHC is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcVersion} { ghc --version | Should -Match $defaultGhcVersion } + + It "Cabal is installed" { + "cabal --version" | Should -ReturnZeroExitCode + } } \ No newline at end of file