-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test to check module version and help version against project…
… version, #49
- Loading branch information
1 parent
e4708bc
commit 75375b3
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
BeforeAll { | ||
# Define the path to the module and the help info file | ||
$modulePath = (Get-Item .\Pipelines.psd1).FullName | ||
$helpInfoPath = (Get-Item .\cabs\Pipelines_cff00216-d0d0-4565-af27-31d9c0400884_HelpInfo.xml).FullName | ||
$projectVersionFilePath = (Get-Item .\Pipelines\Pipelines.csproj).FullName | ||
|
||
# Read the project version | ||
[xml]$project = Get-Content $projectVersionFilePath -Raw | ||
$projectVersion = $project.Project.PropertyGroup.Version; | ||
|
||
# Import the module manifest | ||
$moduleManifest = Import-PowerShellDataFile -Path $modulePath | ||
|
||
[xml]$helpInfo = Get-Content -Path $helpInfoPath | ||
$helpVersion = $helpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureVersion | ||
} | ||
|
||
Describe 'Module Version Checks' { | ||
It 'Module manifest version should match project version' { | ||
$moduleManifest['ModuleVersion'] | Should -BeExactly $projectVersion | ||
} | ||
|
||
It 'HelpInfo.xml version should match project version' { | ||
$helpVersion | Should -BeExactly $projectVersion | ||
} | ||
} |