File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,22 +21,25 @@ Describe "UseSingularNouns" {
2121 $nounViolations [0 ].Message | Should Match $nounViolationMessage
2222 }
2323
24- It " has the correct extent" {
25- $nounViolations [0 ].Extent.Text | Should be " Verb-Files"
26- }
27-
28- It " excludes items from noun whitelist" {
29- $nounViolationScript = @'
30- Function Add-SomeData
31- {
32- Write-Output "Adding some data"
24+ It " has the correct extent" {
25+ $nounViolations [0 ].Extent.Text | Should be " Verb-Files"
3326 }
34- '@
35- Invoke-ScriptAnalyzer - ScriptDefinition $nounViolationScript `
36- - IncludeRule " PSUseSingularNouns" `
37- - OutVariable violations
38- $violations.Count | Should Be 0
3927 }
28+
29+ Context " When function names have nouns from whitelist" {
30+
31+ It " ignores function name ending with Data" {
32+ $nounViolationScript = @'
33+ Function Add-SomeData
34+ {
35+ Write-Output "Adding some data"
36+ }
37+ '@
38+ Invoke-ScriptAnalyzer - ScriptDefinition $nounViolationScript `
39+ - IncludeRule " PSUseSingularNouns" `
40+ - OutVariable violations
41+ $violations.Count | Should Be 0
42+ }
4043 }
4144
4245 Context " When there are no violations" {
You can’t perform that action at this time.
0 commit comments