File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,16 @@ Configuration MyDscConfiguration {
6161 }
6262
6363 Context " Settings file provides whitelist" {
64- $whiteListTestScriptDef = ' gci; cd;'
64+ BeforeAll {
65+ $whiteListTestScriptDef = ' gci; cd;'
66+ $settings = @ {
67+ ' Rules' = @ {
68+ ' PSAvoidUsingCmdletAliases' = @ {
69+ ' Whitelist' = @ (' cd' )
70+ }
71+ }
72+ }
73+ }
6574
6675 It " honors the whitelist provided as hashtable" {
6776 $settings = @ {
@@ -81,5 +90,10 @@ Configuration MyDscConfiguration {
8190 $violations = Invoke-ScriptAnalyzer - ScriptDefinition $whiteListTestScriptDef - Settings $settingsFilePath - IncludeRule $violationName
8291 $violations.Count | Should be 1
8392 }
93+
94+ It " honors the whitelist in a case-insensitive manner" {
95+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition " CD" - Settings $settings - IncludeRule $violationName
96+ $violations.Count | Should Be 0
97+ }
8498 }
8599}
You can’t perform that action at this time.
0 commit comments