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 1
1
Describe " Verifying templating component" {
2
2
BeforeAll {
3
- $outPath = ( Get-Item - Path ' TestDrive:\ ' ).FullName
3
+ $outPath = [ System.IO. Path]::GetTempPath().Trim( " \/ " )
4
4
$resourcePath = Resolve-PSFPath - Path " $PSScriptRoot \..\resources"
5
5
$templateName = ' TestTemplate-{0}' -f (Get-Random )
6
6
}
7
+ AfterAll {
8
+ Remove-Item - Path " $outPath \Test.txt" - ErrorAction Ignore
9
+ }
7
10
8
11
It " Should Record the template correctly" {
9
12
{ New-PSMDTemplate - TemplateName $templateName - FilePath " $resourcePath \þnameþ.txt" - OutPath $outPath - EnableException - ErrorAction Stop } | Should -Not - Throw
27
30
28
31
It " Should Invoke the template correctly" {
29
32
{ 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
31
34
$values = $content | ConvertFrom-StringData - ErrorAction Stop
32
35
$values.Name | Should - Be Test
33
36
$values.Value | Should - Be ' 123'
You can’t perform that action at this time.
0 commit comments