File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
PSModuleDevelopment/tests/functions Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11Describe " 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
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'
You can’t perform that action at this time.
0 commit comments