Skip to content

Commit 106c208

Browse files
committed
Resolve remarks
1 parent b16c85a commit 106c208

File tree

2 files changed

+29
-36
lines changed

2 files changed

+29
-36
lines changed

dsc/tests/dsc_resource_test.tests.ps1

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33

44
Describe 'Invoke a resource test directly' {
55
It 'test can be called on a resource' {
6-
$os = if ($IsWindows)
7-
{
6+
$os = if ($IsWindows) {
87
'Windows'
9-
}
10-
elseif ($IsLinux)
11-
{
8+
} elseif ($IsLinux) {
129
'Linux'
13-
}
14-
elseif ($IsMacOS)
15-
{
10+
} elseif ($IsMacOS) {
1611
'macOS'
17-
}
18-
else
19-
{
12+
} else {
2013
'Unknown'
2114
}
2215

@@ -33,4 +26,4 @@ Describe 'Invoke a resource test directly' {
3326
$LASTEXITCODE | Should -Be 1
3427
$out | Should -BeLike '*ERROR*'
3528
}
36-
}
29+
}

dsc/tests/dsc_variables.tests.ps1

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,44 @@
33

44
Describe 'Configuration variables tests' {
55
It 'Variables example config works' {
6-
$configFile = "$PSScriptRoot/../examples/variables.dsc.yaml"
7-
$out = dsc config get -f $configFile | ConvertFrom-Json
8-
$LASTEXITCODE | Should -Be 0
9-
$out.results[0].result.actualState.output | Should -BeExactly 'myOutput is: Hello world!, myObject is: baz'
6+
$configFile = "$PSScriptRoot/../examples/variables.dsc.yaml"
7+
$out = dsc config get -f $configFile | ConvertFrom-Json
8+
$LASTEXITCODE | Should -Be 0
9+
$out.results[0].result.actualState.output | Should -BeExactly 'myOutput is: Hello world!, myObject is: baz'
1010
}
1111

1212
It 'Duplicated variable takes last value' {
13-
$configYaml = @'
13+
$configYaml = @'
1414
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
1515
variables:
16-
myVariable: foo
17-
myVariable: bar
16+
myVariable: foo
17+
myVariable: bar
1818
resources:
1919
- name: test
20-
type: Microsoft.DSC.Debug/Echo
21-
properties:
22-
output: "[variables('myVariable')]"
20+
type: Microsoft.DSC.Debug/Echo
21+
properties:
22+
output: "[variables('myVariable')]"
2323
'@
24-
$out = dsc config get -i $configYaml | ConvertFrom-Json
25-
Write-Verbose -Verbose $out
26-
$LASTEXITCODE | Should -Be 0
27-
$out.results[0].result.actualState.output | Should -Be 'bar'
24+
$out = dsc config get -i $configYaml | ConvertFrom-Json
25+
Write-Verbose -Verbose $out
26+
$LASTEXITCODE | Should -Be 0
27+
$out.results[0].result.actualState.output | Should -Be 'bar'
2828
}
2929

3030
It 'Missing variable returns error' {
31-
$configYaml = @'
31+
$configYaml = @'
3232
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
3333
variables:
34-
hello: world
34+
hello: world
3535
resources:
3636
- name: test
37-
type: Microsoft.DSC.Debug/Echo
38-
properties:
39-
output: "[variables('myVariable')]"
37+
type: Microsoft.DSC.Debug/Echo
38+
properties:
39+
output: "[variables('myVariable')]"
4040
'@
41-
$out = dsc config get -i $configYaml 2>&1 | Out-String
42-
Write-Verbose -Verbose $out
43-
$LASTEXITCODE | Should -Be 2
44-
$out | Should -BeLike "*Variable 'myVariable' does not exist or has not been initialized yet*"
41+
$out = dsc config get -i $configYaml 2>&1 | Out-String
42+
Write-Verbose -Verbose $out
43+
$LASTEXITCODE | Should -Be 2
44+
$out | Should -BeLike "*Variable 'myVariable' does not exist or has not been initialized yet*"
4545
}
46-
}
46+
}

0 commit comments

Comments
 (0)