File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
PSModuleDevelopment/tests/functions Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 11Describe " Verifying templating component" {
22 BeforeAll {
3- $tmpFolder = New-PSFTempDirectory - Name Template - ModuleName PSModuleDevelopment
43 $resourcePath = Resolve-PSFPath - Path " $PSScriptRoot \..\resources"
54 $templateName = ' TestTemplate-{0}' -f (Get-Random )
65 }
7- AfterAll {
8- Write-Host " Path: $resourcePath "
9- Remove-PSFTempItem - Name Template - ModuleName PSModuleDevelopment
10- }
116
127 It " Should Record the template correctly" {
138 { New-PSMDTemplate - TemplateName $templateName - FilePath " $resourcePath \þnameþ.txt" - EnableException - ErrorAction Stop } | Should -Not - Throw
2116 }
2217
2318 It " Should Invoke the template correctly" {
24- { Invoke-PSMDTemplate - TemplateName $templateName - OutPath $tmpFolder - Name Test - EnableException } | Should -Not - Throw
25- $content = Get-Content - Path " $tmpFolder \Test.txt" - ErrorAction Stop
19+ { Invoke-PSMDTemplate - TemplateName $templateName - OutPath TestDrive:\ - Name Test - EnableException } | Should -Not - Throw
20+ $content = Get-Content - Path " TestDrive: \Test.txt" - ErrorAction Stop
2621 $values = $content | ConvertFrom-StringData - ErrorAction Stop
2722 $values.Name | Should - Be Test
2823 $values.Value | Should - Be ' 123'
You can’t perform that action at this time.
0 commit comments