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 = @{
19
19
20
20
Describe " AlignAssignmentStatement" {
21
21
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 " {
23
23
$def = @'
24
24
$hashtable = @{
25
25
property1 = "value"
26
26
anotherProperty = "another value"
27
27
}
28
28
'@
29
29
30
- # Expected output should be the following
30
+ # Expected output after correction should be the following
31
31
# $hashtable = @{
32
32
# property1 = "value"
33
33
# anotherProperty = "another value"
@@ -37,5 +37,24 @@ $hashtable = @{
37
37
$violations.Count | Should Be 1
38
38
Test-CorrectionExtentFromContent $def $violations 1 ' ' ' '
39
39
}
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
+ }
41
60
}
You can’t perform that action at this time.
0 commit comments