File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -198,12 +198,26 @@ Describe 'Default Shell Configuration Error Handling on Non-Windows Platforms' -
198198
199199 $out = sshdconfig set -- input $inputConfig 2>&1
200200 $LASTEXITCODE | Should -Not - Be 0
201- $out | Should - BeLike ' *is only applicable to Windows*'
201+ $result = $out | ConvertFrom-Json
202+ $found = $false
203+ foreach ($item in $result ) {
204+ if (($item.level -eq ' ERROR' ) -and ($item.fields.message -like ' *is only applicable to Windows*' )) {
205+ $found = $true
206+ }
207+ }
208+ $found | Should - Be $true
202209 }
203210
204211 It ' Should return error for get command' {
205212 $out = sshdconfig get - s windows- global 2>&1
206213 $LASTEXITCODE | Should -Not - Be 0
207- $out | Should - BeLike ' *is only applicable to Windows*'
214+ $result = $out | ConvertFrom-Json
215+ $found = $false
216+ foreach ($item in $result ) {
217+ if (($item.level -eq ' ERROR' ) -and ($item.fields.message -like ' *is only applicable to Windows*' )) {
218+ $found = $true
219+ }
220+ }
221+ $found | Should - Be $true
208222 }
209223}
You can’t perform that action at this time.
0 commit comments