Fix HOMEPATH and Wait-Event tests

On Windows, HOMEPATH is not necessarily `\Users\username`, so the test
was made to match more loosely.

Wait-Event's timeout varied more than expected, so the test's range was
increased.
This commit is contained in:
George Fleming
2016-02-08 10:59:15 -08:00
committed by Andrew Schwartzmeyer
parent 6ce53af354
commit 8adffbb2e2
2 changed files with 4 additions and 3 deletions
@@ -23,8 +23,8 @@
It "Should have the correct HOME" {
if ($isWindows)
{
$expected = "\Users\" + $ENV:USERNAME
$ENV:HOMEPATH | Should Be $expected
$expected = "\Users"
Split-Path $ENV:HOMEPATH -Parent | Should Be $expected
}
else
{
+2 -1
View File
@@ -8,7 +8,8 @@ Describe "Wait-Event" {
# raised because it is fake
Wait-Event -Timeout 1 -SourceIdentifier "FakeEvent"
$stopwatch.Stop()
$stopwatch.ElapsedMilliseconds | Should BeGreaterThan 999
$stopwatch.ElapsedMilliseconds | Should BeGreaterThan 500
$stopwatch.ElapsedMilliseconds | Should BeLessThan 1500
}
}
}