-
-
Notifications
You must be signed in to change notification settings - Fork 478
Description
1. Provide a general summary of the issue in the Title above
It blocks that use the Test parameter, and It blocks that use the TestCases parameter, use different formatting on their test results. Tests using TestCases include single quotes around the test name, while the results that do not use the TestCases parameter, do not have single quotes around the test name. For me, I would prefer that all tests do not include single quotes around the test name, as it provides visually cleaner output.
2. Describe Your Environment
Operating System, Pester version and PowerShell version:
Pester version : 4.4.0 3.4.0 C:\Users\tommymaynard\Documents\WindowsPowerShell\Modules\Pester\4.4.0\Pester.psd1 C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Pester.psd1
PowerShell version : 5.1.17134.165
OS version : Microsoft Windows NT 10.0.17134.03. Expected Behavior
No quotes around test name using It command's TestCases parameter.
4.Current Behavior
Single quotes are added (or not removed), from a test name when using the TestCases parameter.
Function Add-Numbers($a, $b) {
return $a + $b
}
Describe "Add-Numbers" {
It "adds positive numbers" {
$sum = Add-Numbers 2 3
$sum | Should Be 5
}
It "adds negative numbers" {
$sum = Add-Numbers (-2) (-2)
$sum | Should Be (-4)
}
$TestCases = @(
@{First = (-2); Second = 2; Result = 0; TestName = 'adds one negative number to positive number'}
@{First = 'two'; Second = 'three';Result = "twothree"; TestName = 'concatenates strings if given strings'}
)
It -Name '<TestName>' -TestCases $TestCases {
$sum = Add-Numbers $First $Second
$sum | Should Be $Result
}
} # End Describe.
Describing Add-Numbers
[+] adds positive numbers 26ms
[+] adds negative numbers 9ms
[+] 'adds one negative number to positive number' 10ms
[+] 'concatenates strings if given strings' 9ms5. Possible Solution
I do not have an actual coded solution.
6. Context
I would prefer that all test results, whether created using the It command's TestCases parameter or not, produced the identical formatting: no single quotes.