Use HOME instead of HOSTNAME for environment tests

Because HOSTNAME can be tricky, but HOME is always set.
This commit is contained in:
Andrew Schwartzmeyer 2015-11-05 10:11:38 -08:00
parent 6b7262a0d8
commit 7cda20517e
2 changed files with 7 additions and 9 deletions

View file

@ -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
}
}

View file

@ -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
}
}