@@ -123,44 +123,47 @@ Describe "Test importing correct customized rules" {
123
123
$customizedRulePath.Count | Should Be 1
124
124
}
125
125
126
- It " will show the custom rule in the results when given a rule folder path with trailing backslash" {
127
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomizedRulePath $directory \samplerule\ | Where-Object {$_.Message -eq $message }
128
- $customizedRulePath.Count | Should Be 1
129
- }
130
-
131
- It " will show the custom rules when given a glob" {
132
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomizedRulePath $directory \samplerule\samplerule* | Where-Object {$_.Message -eq $message }
133
- $customizedRulePath.Count | Should be 3
134
- }
135
-
136
- It " will show the custom rules when given recurse switch" {
137
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule | Where-Object {$_.Message -eq $message }
138
- $customizedRulePath.Count | Should be 3
139
- }
126
+ if (! $testingLibraryUsage )
127
+ {
128
+ It " will show the custom rule in the results when given a rule folder path with trailing backslash" {
129
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomizedRulePath $directory \samplerule\ | Where-Object {$_.Message -eq $message }
130
+ $customizedRulePath.Count | Should Be 1
131
+ }
132
+
133
+ It " will show the custom rules when given a glob" {
134
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomizedRulePath $directory \samplerule\samplerule* | Where-Object {$_.Message -eq $message }
135
+ $customizedRulePath.Count | Should be 3
136
+ }
137
+
138
+ It " will show the custom rules when given recurse switch" {
139
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule | Where-Object {$_.Message -eq $message }
140
+ $customizedRulePath.Count | Should be 3
141
+ }
140
142
141
- It " will show the custom rules when given glob with recurse switch" {
142
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule\samplerule* | Where-Object {$_.Message -eq $message }
143
- $customizedRulePath.Count | Should be 4
144
- }
145
-
146
- It " will show the custom rules when given glob with recurse switch" {
147
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule* | Where-Object {$_.Message -eq $message }
148
- $customizedRulePath.Count | Should be 3
149
- }
150
-
151
- It " Using IncludeDefaultRules Switch with CustomRulePath" {
152
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomRulePath $directory \samplerule\samplerule.psm1 - IncludeDefaultRules
153
- $customizedRulePath.Count | Should Be 2
154
- }
143
+ It " will show the custom rules when given glob with recurse switch" {
144
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule\samplerule* | Where-Object {$_.Message -eq $message }
145
+ $customizedRulePath.Count | Should be 4
146
+ }
147
+
148
+ It " will show the custom rules when given glob with recurse switch" {
149
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - RecurseCustomRulePath - CustomizedRulePath $directory \samplerule* | Where-Object {$_.Message -eq $message }
150
+ $customizedRulePath.Count | Should be 3
151
+ }
152
+
153
+ It " Using IncludeDefaultRules Switch with CustomRulePath" {
154
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - CustomRulePath $directory \samplerule\samplerule.psm1 - IncludeDefaultRules
155
+ $customizedRulePath.Count | Should Be 2
156
+ }
155
157
156
- It " Using IncludeDefaultRules Switch without CustomRulePath" {
157
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - IncludeDefaultRules
158
- $customizedRulePath.Count | Should Be 1
159
- }
158
+ It " Using IncludeDefaultRules Switch without CustomRulePath" {
159
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1 - IncludeDefaultRules
160
+ $customizedRulePath.Count | Should Be 1
161
+ }
160
162
161
- It " Not Using IncludeDefaultRules Switch and without CustomRulePath" {
162
- $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1
163
- $customizedRulePath.Count | Should Be 1
163
+ It " Not Using IncludeDefaultRules Switch and without CustomRulePath" {
164
+ $customizedRulePath = Invoke-ScriptAnalyzer $directory \TestScript.ps1
165
+ $customizedRulePath.Count | Should Be 1
166
+ }
164
167
}
165
168
166
169
}
0 commit comments