24 lines
1008 B
PowerShell
24 lines
1008 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 linenumbers 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
|
|
}
|
|
}
|