Files
Chronometer/Tests/Get-Chronometer.Tests.ps1
Kevin Marquette bbe311b1dc spell check
2018-12-28 15:03:10 -08:00

24 lines
1009 B
PowerShell

Describe "Function: Get-Chronometer" -Tag Build {
It "Does not throw" {
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
{Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {"Test"} } | Should Not Throw
}
It "Executes a script and gives results" {
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
$results = Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
$results | Should Not BeNullOrEmpty
}
It "Executes a script with line numbers and gives results" {
# Get-Chronometer -Path ScratchFiles\example.ps1 -Script {"Test"}
$params = @{
Path = "$PSScriptRoot\..\ScratchFiles\example.ps1"
Script = {. "$PSScriptRoot\..\ScratchFiles\example.ps1"}
LineNumber = 2,3,5,6
}
$results = Get-Chronometer @params
$results | Should Not BeNullOrEmpty
}
}