mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 20:56:02 +00:00
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files. Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks. Separate PR coming to update contribution document for new source files: #6140 Manually reviewed each change. Fix #6073
46 lines
1020 B
PowerShell
46 lines
1020 B
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
Describe "Environment-Variables" -Tags "CI" {
|
|
|
|
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
|
|
|
|
}
|
|
}
|