Files

28 lines
994 B
PowerShell
Raw Permalink Normal View History

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
2016-07-25 14:01:41 -07:00
Describe "Measure-Command" -Tags "CI" {
2015-11-19 06:22:06 +00:00
Context "Validate return types for Measure-Command" {
It "Should return TimeSpan as the return type" {
Measure-Command { Get-Date } | Should -BeOfType timespan
}
2015-11-19 06:22:06 +00:00
}
Context "Validate that it is executing commands correctly" {
It "Should return TimeSpan after executing a script" {
Measure-Command { Write-Output hi } | Should -BeOfType timespan
}
2015-11-19 06:22:06 +00:00
It "Should return TimeSpan after executing a cmdlet" {
$pesterscript = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath echoscript.ps1
$testfile = $pesterscript
$testcommand = "Write-Output pestertestscript"
$testcommand | Add-Content -Path $testfile
2015-11-19 06:22:06 +00:00
Measure-Command { $pesterscript } | Should -BeOfType timespan
Remove-Item $testfile
}
2015-11-19 06:22:06 +00:00
}
}