Skip to content

Commit

Permalink
try using explicit whitespace in test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgauth committed Feb 7, 2024
1 parent 89ad1c9 commit bc7f14e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dsc/tests/dsc_args.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Describe 'config argument tests' {
Remove-Item -Path $TestDrive/error.txt
}
}

AfterAll {
$env:DSC_RESOURCE_PATH = $oldPath
}
Expand Down Expand Up @@ -188,22 +188,22 @@ resources:
}

It 'input cannot be empty if neither stdin or path is provided' {
dsc resource set -r Microsoft/OSInfo --input '' 2> $TestDrive/error.txt
dsc resource set -r Microsoft/OSInfo --input " " 2> $TestDrive/error.txt
$err = Get-Content $testdrive/error.txt -Raw
$err.Length | Should -Not -Be 0
$LASTEXITCODE | Should -Be 1
}

It 'path contents cannot be empty if neither stdin or input is provided' {
Set-Content -Path $TestDrive/empty.yaml -Value ''
Set-Content -Path $TestDrive/empty.yaml -Value " "
dsc resource set -r Microsoft/OSInfo --path $TestDrive/empty.yaml 2> $TestDrive/error.txt
$err = Get-Content $testdrive/error.txt -Raw
$err.Length | Should -Not -Be 0
$LASTEXITCODE | Should -Be 1
}

It 'document cannot be empty if neither stdin or path is provided' {
dsc config set --document '' 2> $TestDrive/error.txt
dsc config set --document " " 2> $TestDrive/error.txt
$err = Get-Content $testdrive/error.txt -Raw
$err.Length | Should -Not -Be 0
$LASTEXITCODE | Should -Be 4
Expand Down

0 comments on commit bc7f14e

Please sign in to comment.