File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,21 @@ Configuration C1 {
126126
127127 Context ' When Hashtable checking is enabled' {
128128
129+ It ' Should set correction file and description when analyzing a file' {
130+ $path = Join-Path - Path $TestDrive - ChildPath ' unaligned.ps1'
131+ Set-Content - LiteralPath $path - Value ' @{"Key" = "Value"}'
132+
133+ $settings = New-AlignAssignmentSettings - CheckHashtable $true
134+
135+ $violations = Invoke-ScriptAnalyzer - Path $path - Settings $settings |
136+ Get-NonParseDiagnostics
137+
138+ $violations | Should - HaveCount 1
139+ $correction = $violations [0 ].SuggestedCorrections[0 ]
140+ $correction.File | Should - Be ([IO.Path ]::GetFullPath($path ))
141+ $correction.Description | Should - Be ' Assignment statements are not aligned'
142+ }
143+
129144 It ' Should not find violations in empty single-line hashtable' {
130145 $def = ' @{}'
131146
You can’t perform that action at this time.
0 commit comments