From 1d009814544f35ae5b1d07772be763186f72168a Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 14 Mar 2018 09:36:32 +0100 Subject: [PATCH] fix pester test --- tests/ChallengeFile/01_Set-ChallengeFile.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ChallengeFile/01_Set-ChallengeFile.Tests.ps1 b/tests/ChallengeFile/01_Set-ChallengeFile.Tests.ps1 index 631a7f8..3feffe7 100644 --- a/tests/ChallengeFile/01_Set-ChallengeFile.Tests.ps1 +++ b/tests/ChallengeFile/01_Set-ChallengeFile.Tests.ps1 @@ -42,7 +42,7 @@ Describe "Set-ChallengeFile" { } It "Test directory creation for shared store" { if (Test-Path -Path ("{0}\PSCredentialStore" -f $env:ProgramData)) { - Remove-Item -Path ("{0}\PSCredentialStore" -f $env:ProgramData) + Remove-Item -Path ("{0}\PSCredentialStore" -f $env:ProgramData) -Force -Recurse } Set-ChallengeFile Test-Path -Path ("{0}\PSCredentialStore" -f $env:ProgramData) | Should -Be $true @@ -52,7 +52,7 @@ Describe "Set-ChallengeFile" { Mock New-Item {throw "foobar exception"} It "Test exception handling if the root directory could not be created" { if (Test-Path -Path ("{0}\PSCredentialStore" -f $env:ProgramData)) { - Remove-Item -Path ("{0}\PSCredentialStore" -f $env:ProgramData) + Remove-Item -Path ("{0}\PSCredentialStore" -f $env:ProgramData) -Force -Recurse } { Set-ChallengeFile } | Should -Throw "Could not create the parent data dir*" }