-
-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #421 from dlwyatt/Inconclusive
Adding Set-TestInconclusive
- Loading branch information
Showing
6 changed files
with
93 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function New-InconclusiveErrorRecord ([string] $Message, [string] $File, [string] $Line, [string] $LineText) { | ||
$exception = New-Object Exception $Message | ||
$errorID = 'PesterTestInconclusive' | ||
$errorCategory = [Management.Automation.ErrorCategory]::InvalidResult | ||
# we use ErrorRecord.TargetObject to pass structured information about the error to a reporting system. | ||
$targetObject = @{Message = $Message; File = $File; Line = $Line; LineText = $LineText} | ||
$errorRecord = New-Object Management.Automation.ErrorRecord $exception, $errorID, $errorCategory, $targetObject | ||
return $errorRecord | ||
} | ||
|
||
function Set-TestInconclusive { | ||
param ( | ||
[string] $Message | ||
) | ||
|
||
Assert-DescribeInProgress -CommandName Set-TestInconclusive | ||
$lineText = $MyInvocation.Line.TrimEnd("`n") | ||
$line = $MyInvocation.ScriptLineNumber | ||
$file = $MyInvocation.ScriptName | ||
|
||
throw ( New-InconclusiveErrorRecord -Message $Message -File $file -Line $line -LineText $lineText) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters