@@ -204,7 +204,7 @@ function foo {
204204 }
205205 }
206206
207- Context " When a multi-line command is given " {
207+ Context " When a commented-out code block is provided " {
208208
209209 It ' Should preserve relative indentation in commented-out code with <Kind> indentation' - TestCases @ (
210210 @ { Kind = ' space' ; Indentation = ' ' }
@@ -219,17 +219,8 @@ function foo {
219219 " $ ( $Indentation ) Write-Output 'after'"
220220 ' }'
221221 ) -join " `n "
222- $settings = @ {
223- IncludeRules = @ (' PSUseConsistentIndentation' )
224- Rules = @ {
225- PSUseConsistentIndentation = @ {
226- Enable = $true
227- IndentationSize = 4
228- PipelineIndentation = ' NoIndentation'
229- Kind = $Kind
230- }
231- }
232- }
222+ $settings.Rules.PSUseConsistentIndentation.Kind = $Kind
223+ $settings.Rules.PSUseConsistentIndentation.PipelineIndentation = ' NoIndentation'
233224
234225 Invoke-Formatter - ScriptDefinition $scriptDefinition - Settings $settings |
235226 Should - Be $scriptDefinition
@@ -256,22 +247,15 @@ function foo {
256247 " $ ( $Indentation ) Write-Output 'after'"
257248 ' }'
258249 ) -join " `n "
259- $settings = @ {
260- IncludeRules = @ (' PSUseConsistentIndentation' )
261- Rules = @ {
262- PSUseConsistentIndentation = @ {
263- Enable = $true
264- IndentationSize = 4
265- PipelineIndentation = ' NoIndentation'
266- Kind = $Kind
267- }
268- }
269- }
250+ $settings.Rules.PSUseConsistentIndentation.Kind = $Kind
251+ $settings.Rules.PSUseConsistentIndentation.PipelineIndentation = ' NoIndentation'
270252
271253 Invoke-Formatter - ScriptDefinition $scriptDefinition - Settings $settings |
272254 Should - Be $expectedScriptDefinition
273255 }
256+ }
274257
258+ Context " When a multi-line command is given" {
275259 It " When a comment is in the middle of a multi-line statement with preceding and succeeding line continuations" {
276260 $scriptDefinition = @'
277261foo `
0 commit comments