2015-10-23 01:35:31 +02:00
|
|
|
|
Describe "Environment-Variables" {
|
2015-08-24 20:38:32 +02:00
|
|
|
|
It "Should have environment variables" {
|
2015-07-15 19:15:39 +02:00
|
|
|
|
Get-Item ENV: | Should Not BeNullOrEmpty
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-25 00:04:50 +02:00
|
|
|
|
It "Should have a nonempty PATH" {
|
|
|
|
|
$ENV:PATH | Should Not BeNullOrEmpty
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Should contain /bin in the PATH" {
|
|
|
|
|
$ENV:PATH | Should Match "/bin"
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-24 20:38:32 +02:00
|
|
|
|
It "Should be able to access the members of the environment variable" {
|
2015-08-24 22:39:24 +02:00
|
|
|
|
$expected = /bin/bash -c "cd ~ && pwd"
|
|
|
|
|
|
2015-08-25 00:04:50 +02:00
|
|
|
|
(Get-Item ENV:HOME).Value | Should Be $expected
|
2015-08-24 20:38:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Should be able to set the environment variables" {
|
2015-08-25 19:15:21 +02:00
|
|
|
|
$expected = "this is a test environment variable"
|
|
|
|
|
{ $ENV:TESTENVIRONMENTVARIABLE = $expected } | Should Not Throw
|
2015-08-24 20:38:32 +02:00
|
|
|
|
|
|
|
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Not BeNullOrEmpty
|
2015-08-25 19:15:21 +02:00
|
|
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Be $expected
|
2015-07-17 00:52:42 +02:00
|
|
|
|
|
2015-07-15 19:15:39 +02:00
|
|
|
|
}
|
2015-08-24 23:47:06 +02:00
|
|
|
|
|
|
|
|
|
It "Should have the correct HOSTNAME" {
|
2015-08-25 00:04:50 +02:00
|
|
|
|
$expected = /bin/hostname
|
2015-08-24 23:47:06 +02:00
|
|
|
|
|
|
|
|
|
$ENV:HOSTNAME | Should Be $expected
|
|
|
|
|
}
|
2015-07-17 00:52:42 +02:00
|
|
|
|
}
|