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 {
61
61
}
62
62
63
63
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
+ }
65
74
66
75
It " honors the whitelist provided as hashtable" {
67
76
$settings = @ {
@@ -81,5 +90,10 @@ Configuration MyDscConfiguration {
81
90
$violations = Invoke-ScriptAnalyzer - ScriptDefinition $whiteListTestScriptDef - Settings $settingsFilePath - IncludeRule $violationName
82
91
$violations.Count | Should be 1
83
92
}
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
+ }
84
98
}
85
99
}
You can’t perform that action at this time.
0 commit comments