Skip to content

Commit 8fae82e

Browse files
committed
Tests fixes for AvoidPositionalParameters rule.
1 parent 1e6aa68 commit 8fae82e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Tests/Rules/AvoidPositionalParameters.tests.ps1

+3-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ Describe "AvoidPositionalParameters" {
3737
[Parameter(Position=2)]$B,
3838
[Parameter(Position=3)]$C)
3939
}
40-
Foo "a" "b" "c"
41-
}
40+
Foo "a" "b" "c"}
4241
$warnings = Invoke-ScriptAnalyzer -ScriptDefinition "$sb"
43-
$warnings.Count | Should -BeGreaterThan 0
44-
$warnings.RuleName | Should -Contain $violationName
45-
$warnings.Message | Should -Contain "Cmdlet 'Foo' has positional parameter. Please use named parameters instead of positional parameters when calling a command."
42+
$warnings.Count | Should -Be 1
43+
$warnings.RuleName | Should -BeExactly $violationName
4644
}
4745
}
4846
}

0 commit comments

Comments
 (0)