mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
This restructuring moves tests to a directory name which matches the module in which the cmdlet resides which should improve the discoverability of a specific test. For tests which are not about cmdlets in a module, new directories have been created to make those tests easier to find as well
44 lines
915 B
PowerShell
44 lines
915 B
PowerShell
Describe "Environment-Variables" {
|
|
|
|
It "Should have environment variables" {
|
|
Get-Item ENV: | Should Not BeNullOrEmpty
|
|
}
|
|
|
|
It "Should have a nonempty PATH" {
|
|
$ENV:PATH | Should Not BeNullOrEmpty
|
|
}
|
|
|
|
It "Should contain /bin in the PATH" {
|
|
if ($IsWindows)
|
|
{
|
|
$ENV:PATH | Should Match "C:"
|
|
}
|
|
else
|
|
{
|
|
$ENV:PATH | Should Match "/bin"
|
|
}
|
|
}
|
|
|
|
It "Should have the correct HOME" {
|
|
if ($IsWindows)
|
|
{
|
|
$expected = "\Users"
|
|
Split-Path $ENV:HOMEPATH -Parent | Should Be $expected
|
|
}
|
|
else
|
|
{
|
|
$expected = /bin/bash -c "cd ~ && pwd"
|
|
$ENV:HOME | Should Be $expected
|
|
}
|
|
}
|
|
|
|
It "Should be able to set the environment variables" {
|
|
$expected = "this is a test environment variable"
|
|
{ $ENV:TESTENVIRONMENTVARIABLE = $expected } | Should Not Throw
|
|
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Not BeNullOrEmpty
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Be $expected
|
|
|
|
}
|
|
}
|