File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ $settings = @{
1919
2020Describe " AlignAssignmentStatement" {
2121 Context " Hashtable" {
22- It " Should align assignment statements in a hashtable" {
22+ It " Should align assignment statements in a hashtable when need to add whitespace " {
2323 $def = @'
2424$hashtable = @{
2525 property1 = "value"
2626 anotherProperty = "another value"
2727}
2828'@
2929
30- # Expected output should be the following
30+ # Expected output after correction should be the following
3131# $hashtable = @{
3232# property1 = "value"
3333# anotherProperty = "another value"
@@ -37,5 +37,24 @@ $hashtable = @{
3737 $violations.Count | Should Be 1
3838 Test-CorrectionExtentFromContent $def $violations 1 ' ' ' '
3939 }
40- }
40+
41+ It " Should align assignment statements in a hashtable when need to remove whitespace" {
42+ $def = @'
43+ $hashtable = @{
44+ property1 = "value"
45+ anotherProperty = "another value"
46+ }
47+ '@
48+
49+ # Expected output should be the following
50+ # $hashtable = @{
51+ # property1 = "value"
52+ # anotherProperty = "another value"
53+ # }
54+
55+ $violations = Invoke-ScriptAnalyzer - ScriptDefinition $def - Settings $settings
56+ $violations.Count | Should Be 1
57+ Test-CorrectionExtentFromContent $def $violations 1 ' ' ' '
58+ }
59+ }
4160}
You can’t perform that action at this time.
0 commit comments