Skip to content

Commit 2abfb00

Browse files
SteveL-MSFTSteve Lee (POWERSHELL HE/HIM) (from Dev Box)
authored andcommitted
add ps adapter resource tests
1 parent a35ba7a commit 2abfb00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,4 +364,16 @@ Describe 'PowerShell adapter resource tests' {
364364
$res = $r | ConvertFrom-Json
365365
$res.actualState.HashTableProp.Name | Should -Be 'DSCv3'
366366
}
367+
368+
It 'Specifying version works' {
369+
$out = dsc resource get -r TestClassResource/TestClassResource --version 0.0.1 | ConvertFrom-Json
370+
$LASTEXITCODE | Should -Be 0
371+
$out.actualState.Ensure | Should -BeExactly 'Present'
372+
}
373+
374+
It 'Specifying a non-existent version returns an error' {
375+
$null = dsc resource get -r TestClassResource/TestClassResource --version 0.0.2 2> $TestDrive/error.log
376+
$LASTEXITCODE | Should -Be 7
377+
Get-Content -Path $TestDrive/error.log | Should -Match 'Resource not found: TestClassResource/TestClassResource 0.0.2'
378+
}
367379
}

0 commit comments

Comments
 (0)