Skip to content

Commit 6eb2d05

Browse files
author
Andrew
committed
added test
1 parent 88d0b3a commit 6eb2d05

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dsc/tests/dsc_osinfo.tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,20 @@ Describe 'Tests for osinfo examples' {
1818
$LASTEXITCODE | Should -Be 0
1919
$out.results[0].result.inDesiredState | Should -Be $IsMacOS
2020
}
21+
22+
It 'Verify dsc home directory is added to PATH to find included resources' {
23+
$oldPath = $env:PATH
24+
try {
25+
$exe_path = Resolve-Path "$PSScriptRoot/../../bin/debug"
26+
# Remove unwanted elements
27+
$new_path = ($oldPath.Split([System.IO.Path]::PathSeparator) | Where-Object { $_ -ne $exe_path }) -join [System.IO.Path]::PathSeparator
28+
$env:PATH = $new_path
29+
30+
$null = & "$PSScriptRoot/../../bin/debug/dsc" config test -p "$PSScriptRoot/../examples/osinfo_parameters.dsc.yaml"
31+
$LASTEXITCODE | Should -Be 0
32+
}
33+
finally {
34+
$env:PATH = $oldPath
35+
}
36+
}
2137
}

0 commit comments

Comments
 (0)