Skip to content

Commit bb16a0d

Browse files
committed
create test file
1 parent 5b80546 commit bb16a0d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ Describe 'PowerShell adapter resource tests' {
2525

2626
It 'Get works on config with File resource for WinPS' -Skip:(!$IsWindows){
2727

28+
'test' | Set-Content -Path c:\test.txt -Force
2829
$r = Get-Content -Raw $winpsConfigPath | dsc config get
2930
$LASTEXITCODE | Should -Be 0
3031
$res = $r | ConvertFrom-Json
31-
$res.results[0].result.actualState.result[0].properties.DestinationPath | Should -BeNullOrEmpty
32+
$res.results[0].result.actualState.result[0].properties.DestinationPath | Should -Be 'c:\test.txt'
3233
}
3334

3435
<#

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ Describe 'PowerShell adapter resource tests' {
3030

3131
It 'Get works on Binary "File" resource' -Skip:(!$IsWindows){
3232

33-
$r = '{"DestinationPath":"$env:TEMP\\test.txt"}' | dsc resource get -r 'PSDesiredStateConfiguration/File'
33+
'test' | Set-Content -Path c:\test.txt -Force
34+
$r = '{"DestinationPath":"c:\\test.txt"}' | dsc resource get -r 'PSDesiredStateConfiguration/File'
3435
$LASTEXITCODE | Should -Be 0
3536
$res = $r | ConvertFrom-Json
36-
$res.actualState.result.properties.Contents | Should -BeNullOrEmpty
37+
$res.actualState.result.properties.DestinationPath | Should -Be 'c:\test.txt'
3738
}
3839

3940
It 'Get works on traditional "Script" resource' -Skip:(!$IsWindows){
4041

41-
$r = '{"GetScript": "Get-Content $env:TEMP\\tests.txt", "SetScript": "throw", "TestScript": "throw"}' | dsc resource get -r 'PSDesiredStateConfiguration/Script'
42+
'test' | Set-Content -Path c:\test.txt -Force
43+
$r = '{"GetScript": "Get-Content c:\\tests.txt", "SetScript": "throw", "TestScript": "throw"}' | dsc resource get -r 'PSDesiredStateConfiguration/Script'
4244
$LASTEXITCODE | Should -Be 0
4345
$res = $r | ConvertFrom-Json
44-
$res.actualState.result.properties.GetScript | Should -BeNullOrEmpty
46+
$res.actualState.result.properties.GetScript | Should -Be 'c:\test.txt'
4547
}
4648

4749
It 'Get works on class-based resource' -Skip:(!$IsWindows){

0 commit comments

Comments
 (0)