Skip to content

Commit fed6be7

Browse files
changing temp path
1 parent 52dcd56 commit fed6be7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PSModuleDevelopment/tests/functions/Templates.Tests.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
Describe "Verifying templating component" {
22
BeforeAll {
3-
$outPath = (Get-Item -Path 'TestDrive:\').FullName
3+
$outPath = [System.IO.Path]::GetTempPath().Trim("\/")
44
$resourcePath = Resolve-PSFPath -Path "$PSScriptRoot\..\resources"
55
$templateName = 'TestTemplate-{0}' -f (Get-Random)
66
}
7+
AfterAll {
8+
Remove-Item -Path "$outPath\Test.txt" -ErrorAction Ignore
9+
}
710

811
It "Should Record the template correctly" {
912
{ New-PSMDTemplate -TemplateName $templateName -FilePath "$resourcePath\þnameþ.txt" -OutPath $outPath -EnableException -ErrorAction Stop } | Should -Not -Throw
@@ -27,7 +30,7 @@
2730

2831
It "Should Invoke the template correctly" {
2932
{ Invoke-PSMDTemplate -TemplateName $templateName -Path $outPath -OutPath $outPath -Name Test -EnableException } | Should -Not -Throw
30-
$content = Get-Content -Path "TestDrive:\Test.txt" -ErrorAction Stop
33+
$content = Get-Content -Path "$outPath\Test.txt" -ErrorAction Stop
3134
$values = $content | ConvertFrom-StringData -ErrorAction Stop
3235
$values.Name | Should -Be Test
3336
$values.Value | Should -Be '123'

0 commit comments

Comments
 (0)