Skip to content

Commit 329401d

Browse files
author
Steve Lee (POWERSHELL HE/HIM) (from Dev Box)
committed
update tests
1 parent f28eb73 commit 329401d

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

dsc/tests/dsc_args.tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Describe 'config argument tests' {
6969
param($text)
7070
$output = $text | dsc resource get -r Microsoft.Windows/Registry
7171
$output = $output | ConvertFrom-Json
72-
$output.actualState.'$id' | Should -BeExactly 'https://developer.microsoft.com/json-schemas/windows/registry/20230303/Microsoft.Windows.Registry.schema.json'
7372
$output.actualState.keyPath | Should -BeExactly 'HKLM\Software\Microsoft\Windows NT\CurrentVersion'
7473
$output.actualState.valueName | Should -BeExactly 'ProductName'
7574
$output.actualState.valueData.String | Should -Match 'Windows .*'

dsc/tests/dsc_get.tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Describe 'resource get tests' {
3232
$output = $json | dsc resource get -r $resource
3333
$LASTEXITCODE | Should -Be 0
3434
$output = $output | ConvertFrom-Json
35-
$output.actualState.'$id' | Should -BeExactly 'https://developer.microsoft.com/json-schemas/windows/registry/20230303/Microsoft.Windows.Registry.schema.json'
3635
$output.actualState.keyPath | Should -BeExactly 'HKLM\Software\Microsoft\Windows NT\CurrentVersion'
3736
$output.actualState.valueName | Should -BeExactly 'ProductName'
3837
$output.actualState.valueData.String | Should -Match 'Windows .*'

dsc/tests/dsc_set.tests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Describe 'resource set tests' {
6161
"_exist": false
6262
}
6363
'@
64-
$json | registry config set
64+
$null = registry config set --input $json
6565
}
6666
}
6767

@@ -73,11 +73,12 @@ Describe 'resource set tests' {
7373
"_exist": false
7474
}
7575
'@
76-
$json | registry config set
76+
$null = registry config set --input $json
7777
}
7878
}
7979

80-
It 'can set and remove a registry value' -Skip:(!$IsWindows) {
80+
# test pending changes in engine to call delete if _exist is not handled directly
81+
It 'can set and remove a registry value' -Pending {
8182
$json = @'
8283
{
8384
"keyPath": "HKCU\\1\\2\\3",

dsc/tests/dsc_test.tests.ps1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Describe 'resource test tests' {
99
"valueName": "ProductName"
1010
}
1111
'@
12-
$current = $json | registry config get
12+
$current = registry config get --input $json
1313
$out = $current | dsc resource test -r Microsoft.Windows/registry
1414
$LASTEXITCODE | Should -Be 0
1515
$out = $out | ConvertFrom-Json
@@ -49,10 +49,9 @@ Describe 'resource test tests' {
4949
$LASTEXITCODE | Should -Be 0
5050
$out = $out | ConvertFrom-Json
5151
$out.inDesiredState | Should -BeFalse
52-
$out.differingProperties.Count | Should -Be 3
53-
$out.differingProperties[0] | Should -BeExactly 'valueName'
54-
$out.differingProperties[1] | Should -BeExactly 'valueData'
55-
$out.differingProperties[2] | Should -BeExactly '_exist'
52+
$out.differingProperties.Count | Should -Be 2
53+
$out.differingProperties[0] | Should -BeExactly 'valueData'
54+
$out.differingProperties[1] | Should -BeExactly '_exist'
5655
}
5756

5857
It 'can accept the use of --format as a subcommand' {

registry/tests/registry.config.set.tests.ps1

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,4 @@ Describe 'registry config set tests' {
2929
$result.valueData.String | Should -Be 'World'
3030
($result.psobject.properties | Measure-Object).Count | Should -Be 3
3131
}
32-
33-
It 'Can set a key to be absent' -Skip:(!$IsWindows) {
34-
$json = @'
35-
{
36-
"keyPath": "HKCU\\1",
37-
"_exist": false
38-
}
39-
'@
40-
$out = registry config set --input $json
41-
$LASTEXITCODE | Should -Be 0
42-
$result = $out | ConvertFrom-Json
43-
$result.keyPath | Should -BeExactly 'HKCU\1'
44-
$result._exist | Should -Be $false
45-
($result.psobject.properties | Measure-Object).Count | Should -Be 3
46-
}
4732
}

0 commit comments

Comments
 (0)