@@ -42,25 +42,27 @@ Describe 'Build-Manifest' {
4242 $manifest.Description | Should - Be ' A module'
4343 }
4444
45- It ' adds resources/ paths when CopyResourcesToModuleRoot is false' {
45+ It ' records resource manifest entries for CopyResourcesToModuleRoot=<CopyResourcesToModuleRoot>' - ForEach @ (
46+ @ {
47+ CopyResourcesToModuleRoot = $false
48+ ExpectedFormat = ' resources/MyFormat.Format.ps1xml'
49+ ExpectedType = ' resources/MyTypes.Types.ps1xml'
50+ }
51+ @ {
52+ CopyResourcesToModuleRoot = $true
53+ ExpectedFormat = ' MyFormat.Format.ps1xml'
54+ ExpectedType = ' MyTypes.Types.ps1xml'
55+ }
56+ ) {
57+ $script :ctx.CopyResourcesToModuleRoot = $CopyResourcesToModuleRoot
4658 Set-Content - Path (Join-Path $script :ctx.ResourcesDir ' MyFormat.Format.ps1xml' ) - Value ' <x/>'
4759 Set-Content - Path (Join-Path $script :ctx.ResourcesDir ' MyTypes.Types.ps1xml' ) - Value ' <x/>'
4860 Mock Get-NovaBuildProjectInfo { $script :ctx }
4961 Mock Assert-ManifestSchema {}
5062 Build-Manifest - ProjectInfo ([pscustomobject ]@ {})
5163 $manifest = Import-PowerShellDataFile - Path $script :ctx.ManifestFilePSD1
52- ($manifest.FormatsToProcess -join ' ,' ) | Should -Match ' resources'
53- ($manifest.TypesToProcess -join ' ,' ) | Should -Match ' resources'
54- }
55-
56- It ' adds bare filenames when CopyResourcesToModuleRoot is true' {
57- $script :ctx.CopyResourcesToModuleRoot = $true
58- Set-Content - Path (Join-Path $script :ctx.ResourcesDir ' MyFormat.Format.ps1xml' ) - Value ' <x/>'
59- Mock Get-NovaBuildProjectInfo { $script :ctx }
60- Mock Assert-ManifestSchema {}
61- Build-Manifest - ProjectInfo ([pscustomobject ]@ {})
62- $manifest = Import-PowerShellDataFile - Path $script :ctx.ManifestFilePSD1
63- $manifest.FormatsToProcess | Should - Be ' MyFormat.Format.ps1xml'
64+ $manifest.FormatsToProcess | Should - Be $ExpectedFormat
65+ $manifest.TypesToProcess | Should - Be $ExpectedType
6466 }
6567
6668 It ' sets Prerelease when version has a prerelease label' {
0 commit comments