Skip to content

Commit

Permalink
Fix Write-PesterStart to allow hashtables in $Path
Browse files Browse the repository at this point in the history
Fix for:
 - Unexpected output when passing hashtable to Invoke-Pester pester#699
 - Bug in output where multiple Paths are passed in to -Scripts at Invoke-Pester pester#710

Changes:
 - Simply tests if there is a path property, if so uses it for the message formatting. Otherwise, falls back to original method.
 - `-join ', '` was used to provide consistency with current messages, as the default ("', '") has no bracketing quotes.
  • Loading branch information
JPRuskin authored Jul 14, 2017
1 parent db9c5e8 commit d3e514c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Functions/Output.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ function Write-PesterStart {

$OFS = $ReportStrings.MessageOfs

$message = $ReportStrings.StartMessage -f "$($Path)"
if ($Path.Path) {
$message = $ReportStrings.StartMessage -f "$($Path.Path -join ', ')"
} else {
$message = $ReportStrings.StartMessage -f "$($Path -join ', ')"
}
if ($PesterState.TestNameFilter) {
$message += $ReportStrings.FilterMessage -f "$($PesterState.TestNameFilter)"
}
Expand Down

0 comments on commit d3e514c

Please sign in to comment.