mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Use HOME instead of HOSTNAME for environment tests
Because HOSTNAME can be tricky, but HOME is always set.
This commit is contained in:
@@ -11,9 +11,13 @@
|
||||
$ENV:PATH | Should Match "/bin"
|
||||
}
|
||||
|
||||
It "Should have the correct HOME" {
|
||||
$expected = /bin/bash -c "cd ~ && pwd"
|
||||
$ENV:HOME | Should Be $expected
|
||||
}
|
||||
|
||||
It "Should be able to access the members of the environment variable" {
|
||||
$expected = /bin/bash -c "cd ~ && pwd"
|
||||
|
||||
(Get-Item ENV:HOME).Value | Should Be $expected
|
||||
}
|
||||
|
||||
@@ -25,10 +29,4 @@
|
||||
$ENV:TESTENVIRONMENTVARIABLE | Should Be $expected
|
||||
|
||||
}
|
||||
|
||||
It "Should have the correct HOSTNAME" {
|
||||
$expected = /bin/hostname
|
||||
|
||||
$ENV:HOSTNAME | Should Be $expected
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
}
|
||||
|
||||
It "Should return true if used on components other than filesystem objects" {
|
||||
Test-Path Alias:\gci | Should Be $true
|
||||
Test-Path Env:\HOSTNAME | Should Be $true
|
||||
Test-Path Alias:\gci | Should Be $true
|
||||
Test-Path Env:\HOME | Should Be $true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user