Files
runner-images-sangeeth/images/win/scripts/Tests/Rust.Tests.ps1
Aleksandr Chebotov 0c4dca229d Replace current validates with pester testing approach #5 (#1232)
* ,oving to the pester approach part #5

* moving to the pester approach part #5

* fixed PostgreSQL tests

* return Validate-Svn.ps1

* fixed Selenium test

* fixed rust test

* fix rust test
2020-07-20 18:57:00 +03:00

27 lines
1.0 KiB
PowerShell

Describe "Rust" {
$rustTools = @(
@{ToolName = "rustup"; binPath = "C:\Rust\.cargo\bin\rustup.exe"}
@{ToolName = "rustc"; binPath = "C:\Rust\.cargo\bin\rustc.exe"}
@{ToolName = "cargo"; binPath = "C:\Rust\.cargo\bin\cargo.exe"}
@{ToolName = "cargo audit"; binPath = "C:\Rust\.cargo\bin\cargo-audit.exe"}
@{ToolName = "cargo outdated"; binPath = "C:\Rust\.cargo\bin\cargo-outdated.exe"}
)
$rustEnvNotExists = @(
@{envVar = "RUSTUP_HOME"}
@{envVar = "CARGO_HOME"}
)
It "C:\Rust\.rustup and C:\Rust\.cargo folders exist" {
"C:\Rust\.rustup", "C:\Rust\.cargo" | Should -Exist
}
It "<envVar> environment variable does not exist" -TestCases $rustEnvNotExists {
[Environment]::GetEnvironmentVariables("Machine").ContainsKey($envVar) | Should -BeFalse
}
It "<ToolName> is installed to the '<binPath>' folder" -TestCases $rustTools {
"$ToolName --version" | Should -ReturnZeroExitCode
$binPath | Should -Exist
}
}