Files
PowerShell-PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1
T
James Truher 9e225ccae2 changes tags for tests
Start using tags CI, Feature, Scenario
2016-07-27 12:06:51 -07:00

27 lines
822 B
PowerShell

Describe "Measure-Command" -Tags "CI" {
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
}
}
}