Skip to content

Commit ea38998

Browse files
author
Kapil Borle
committed
Fix tests of UseConsistentIndentation tests
1 parent f52c770 commit ea38998

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

Tests/Rules/UseConsistentIndentation.tests.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
Import-Module PSScriptAnalyzer
2-
$ruleName = "PSUseConsistentIndentation"
2+
$settings = @{
3+
IncludeRules = @("PSUseConsistentIndentation")
4+
Rules = @{
5+
PSUseConsistentIndentation = @{
6+
Enable = $true
7+
IndentationSize = 4
8+
}
9+
}
10+
}
11+
312

413
Describe "UseConsistentIndentation" {
514
Context "When top level indentation is not consistent" {
@@ -10,7 +19,8 @@ Describe "UseConsistentIndentation" {
1019
1120
}
1221
'@
13-
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -IncludeRule $ruleName
22+
23+
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings
1424
}
1525

1626
It "Should detect a violation" {
@@ -26,7 +36,7 @@ function foo ($param1)
2636
"abc"
2737
}
2838
'@
29-
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -IncludeRule $ruleName
39+
$violations = Invoke-ScriptAnalyzer -ScriptDefinition $def -Settings $settings
3040
}
3141

3242
It "Should detect a violation" {

0 commit comments

Comments
 (0)