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 1
1
Describe " Verifying templating component" {
2
2
BeforeAll {
3
- $tmpFolder = New-PSFTempDirectory - Name Template - ModuleName PSModuleDevelopment
4
3
$resourcePath = Resolve-PSFPath - Path " $PSScriptRoot \..\resources"
5
4
$templateName = ' TestTemplate-{0}' -f (Get-Random )
6
5
}
7
- AfterAll {
8
- Write-Host " Path: $resourcePath "
9
- Remove-PSFTempItem - Name Template - ModuleName PSModuleDevelopment
10
- }
11
6
12
7
It " Should Record the template correctly" {
13
8
{ New-PSMDTemplate - TemplateName $templateName - FilePath " $resourcePath \þnameþ.txt" - EnableException - ErrorAction Stop } | Should -Not - Throw
21
16
}
22
17
23
18
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
26
21
$values = $content | ConvertFrom-StringData - ErrorAction Stop
27
22
$values.Name | Should - Be Test
28
23
$values.Value | Should - Be ' 123'
You can’t perform that action at this time.
0 commit comments