1
- Describe " Validating the module manifest" {
1
+ Describe " Validating the module manifest" {
2
2
$moduleRoot = (Resolve-Path " $PSScriptRoot \..\.." ).Path
3
3
$manifest = ((Get-Content " $moduleRoot \PSModuleDevelopment.psd1" ) -join " `n " ) | Invoke-Expression
4
4
[version ]$moduleVersion = Get-Item " $moduleRoot \PSModuleDevelopment.psm1" | Select-String - Pattern ' \$script:PSModuleVersion = "(.*?)"' | ForEach-Object { $_.Matches [0 ].Groups[1 ].Value }
8
8
$count = (Compare-Object - ReferenceObject $files.BaseName - DifferenceObject $manifest.FunctionsToExport ).Count
9
9
$count | Should be 0
10
10
}
11
-
11
+
12
12
It " Exports none of its internal functions" {
13
13
$files = Get-ChildItem " $moduleRoot \internal\functions" - Recurse - File - Filter " *.ps1"
14
14
$files | Where-Object BaseName -In $manifest.FunctionsToExport | Should Be $null
15
15
}
16
-
16
+
17
17
It " Has the same version as the psm1 file" {
18
18
([version ]$manifest.ModuleVersion ) | Should Be $moduleVersion
19
19
}
20
20
}
21
-
21
+
22
22
Context " Individual file validation" {
23
23
It " The root module file exists" {
24
24
Test-Path " $moduleRoot \$ ( $manifest.RootModule ) " | Should Be $true
25
25
}
26
-
26
+
27
27
foreach ($format in $manifest.FormatsToProcess )
28
28
{
29
29
It " The file $format should exist" {
30
30
Test-Path " $moduleRoot \$format " | Should Be $true
31
31
}
32
32
}
33
-
33
+
34
34
foreach ($type in $manifest.TypesToProcess )
35
35
{
36
36
It " The file $type should exist" {
37
37
Test-Path " $moduleRoot \$type " | Should Be $true
38
38
}
39
39
}
40
-
40
+
41
41
foreach ($assembly in $manifest.RequiredAssemblies )
42
42
{
43
43
It " The file $assembly should exist" {
44
44
Test-Path " $moduleRoot \$assembly " | Should Be $true
45
45
}
46
46
}
47
+
48
+ foreach ($tag in $manifest.PrivateData.PSData.Tags ) {
49
+ It " Tags should have no spaces in name" {
50
+ $tag -match " " | Should - Be $false
51
+ }
52
+ }
47
53
}
48
- }
54
+ }
0 commit comments