2015-07-22 01:05:43 +02:00
|
|
|
|
Describe "Test-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-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-24 20:38:32 +02:00
|
|
|
|
(Get-Item ENV:HOME).Value | Should Be $expected
|
2015-07-24 19:38:51 +02:00
|
|
|
|
(Get-Item ENV:HOSTNAME).Value | Should Not BeNullOrEmpty
|
|
|
|
|
(Get-Item ENV:PATH).Value | Should Not BeNullOrEmpty
|
2015-08-24 20:38:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Should be able to set the environment variables" {
|
|
|
|
|
{ $ENV:TESTENVIRONMENTVARIABLE = "this is a test environment variable" } | Should Not Throw
|
|
|
|
|
|
|
|
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Not BeNullOrEmpty
|
|
|
|
|
$ENV:TESTENVIRONMENTVARIABLE | Should Be "this is a test environment variable"
|
2015-07-17 00:52:42 +02:00
|
|
|
|
|
2015-07-15 19:15:39 +02:00
|
|
|
|
}
|
2015-07-17 00:52:42 +02:00
|
|
|
|
}
|