mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
This restructuring moves tests to a directory name which matches the module in which the cmdlet resides which should improve the discoverability of a specific test. For tests which are not about cmdlets in a module, new directories have been created to make those tests easier to find as well
27 lines
811 B
PowerShell
27 lines
811 B
PowerShell
Describe "Measure-Command" {
|
|
|
|
Context "Validate return types for Measure-Command" {
|
|
|
|
It "Should return TimeSpan as the return type" {
|
|
(Measure-Command { Get-Date }).GetType() | Should Be timespan
|
|
}
|
|
}
|
|
|
|
Context "Validate that it is executing commands correctly" {
|
|
|
|
It "Should return TimeSpan after executing a script" {
|
|
(Measure-Command { echo hi }).GetType() | Should Be timespan
|
|
}
|
|
|
|
It "Should return TimeSpan after executing a cmdlet" {
|
|
$pesterscript = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath echoscript.ps1
|
|
$testfile = $pesterscript
|
|
$testcommand = "echo pestertestscript"
|
|
$testcommand | Add-Content -Path $testfile
|
|
|
|
(Measure-Command { $pesterscript }).GetType() | Should Be timespan
|
|
Remove-Item $testfile
|
|
}
|
|
}
|
|
}
|