Skip to content

Commit a308268

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
update ps-adapter test due to change in behavior
1 parent 1f8e4c6 commit a308268

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

powershell-adapter/Tests/powershellgroup.config.tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Describe 'PowerShell adapter resource tests' {
135135
$res.results.result.actualState.result.properties.Prop1 | Should -Be $TestDrive
136136
}
137137

138-
It 'DSC_CONFIG_ROOT env var does not exist when config is piped from stdin' -Skip:(!$IsWindows){
138+
It 'DSC_CONFIG_ROOT env var is cwd when config is piped from stdin' -Skip:(!$IsWindows){
139139

140140
$yaml = @"
141141
`$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
@@ -149,8 +149,8 @@ Describe 'PowerShell adapter resource tests' {
149149
properties:
150150
Name: "[envvar('DSC_CONFIG_ROOT')]"
151151
"@
152-
$testError = & {$yaml | dsc config get 2>&1}
153-
$testError | Select-String 'Environment variable not found' -Quiet | Should -BeTrue
154-
$LASTEXITCODE | Should -Be 2
152+
$out = $yaml | dsc config get | ConvertFrom-Json
153+
$LASTEXITCODE | Should -Be 0
154+
$out.results[0].result.actualState.result[0].properties.Name | Should -BeExactly (Get-Location).Path
155155
}
156156
}

0 commit comments

Comments
 (0)