Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Functions/It.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,17 @@ function ItImpl
$capture = $args[0].Groups[1].Value
if ($testCase.Contains($capture))
{
Format-Nicely ($testCase[$capture])
$value = $testCase[$capture]
# skip adding quotes to non-empty strings to avoid adding junk to the
# test name in case you want to expand captures like 'because' or test name
if ($value -isnot [string] -or [string]::IsNullOrEmpty($value))
{
Format-Nicely $value
}
else
{
$value
}
}
else
{
Expand Down