Update test framework and tests to support 4x version of Pester (#6064)

* Test fixes and changes needed to support Pester 4.0.8

* Replace 'Should Contain' with new 'Should FileContentMatch' assertion

Explicitly check for string creation with write-output

* Use the current version of pester and install it in modulesDir

* Simplify logic for relative path test.

Multiple '..' is not needed for a relative path, a single one will do. Also, on multi-drive systems using split-path -noqualifier will probably do the wrong thing with regard to constructing a correct path.
Remove extraneous Should Not Throw test, if this throws, the test will fail, we don't need to explicitly assert the not throw

* In some environments it is possible that computer name is 'localhost', so that should be allowed

* [feature] Add link for migrating tests from Pester v3 to v4

Fix up capitalization and white space issues
Change one test to check FullyQualifiedErrorId rather than just `Should Throw`

* [feature] update invoke-item test to handle the case where multiple notepad processes are running

* Fix spelling issue with Pester 4x, calling it Pester 4 should be sufficient
This commit is contained in:
James Truher [MSFT]
2018-02-05 11:58:25 -08:00
committed by Aditya Patwardhan
parent fa40a87bd7
commit 99a7d38cae
25 changed files with 120 additions and 128 deletions
@@ -90,7 +90,7 @@
foreach($command in $commands)
{
$command.GetType().Name | should be @("AliasInfo","FunctionInfo","CmdletInfo","FilterInfo")
$command.GetType().Name | Should BeIn @("AliasInfo","FunctionInfo","CmdletInfo","FilterInfo")
}
}
@@ -102,4 +102,4 @@
It "Get- is prepended to commands" {
(& 'location').Path | Should Be (get-location).Path
}
}
}