Skip to content

Commit 7663c74

Browse files
author
Andrew
committed
Added test for the binary File resource
1 parent ccb51fa commit 7663c74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

powershell-adapter/Tests/win_powershellgroup.tests.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ Describe 'WindowsPowerShell adapter resource tests' {
4343
$res.actualState.result.properties.DestinationPath | Should -Be "$testFile"
4444
}
4545

46+
It 'Set works on Binary "File" resource' -Skip:(!$IsWindows){
47+
48+
$testFile = "$testdrive\test.txt"
49+
$r = '{"DestinationPath":"' + $testFile.replace('\','\\') + '", type: File, contents: HelloWorld, Ensure: present}' | dsc resource set -r 'PSDesiredStateConfiguration/File'
50+
$LASTEXITCODE | Should -Be 0
51+
Get-Content -Raw -Path $testFile | Should -Be "HelloWorld"
52+
}
53+
4654
It 'Get works on traditional "Script" resource' -Skip:(!$IsWindows){
4755

4856
$testFile = "$testdrive\test.txt"

0 commit comments

Comments
 (0)