mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
* Add autoload for TestHelpers.psm1 Test.Helpers.psm1 was renamed to TestHelpers.psm1 * Resolve conflit and rebase Add autoload for TestLanguage.psm1 * Remove unneeded comments from PSD1 files * Rename test modules Remove approved verbs (Get-Verb) from module names. * Enhance ShouldBeErrorId to output exception into pipeline for later analysis * Remove unneeded comments * Resolve merge conflict
29 lines
1.2 KiB
PowerShell
29 lines
1.2 KiB
PowerShell
Describe "New-ModuleManifest tests" -tags "CI" {
|
|
BeforeEach {
|
|
New-Item -ItemType Directory -Path testdrive:/module
|
|
$testModulePath = "testdrive:/module/test.psd1"
|
|
}
|
|
|
|
AfterEach {
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue testdrive:/module
|
|
}
|
|
|
|
It "Uris with spaces are allowed and escaped correctly" {
|
|
$testUri = [Uri]"http://foo.com/hello world"
|
|
$absoluteUri = $testUri.AbsoluteUri
|
|
|
|
New-ModuleManifest -Path $testModulePath -ProjectUri $testUri -LicenseUri $testUri -IconUri $testUri -HelpInfoUri $testUri
|
|
$module = Test-ModuleManifest -Path $testModulePath
|
|
$module.HelpInfoUri | Should BeExactly $absoluteUri
|
|
$module.PrivateData.PSData.IconUri | Should BeExactly $absoluteUri
|
|
$module.PrivateData.PSData.LicenseUri | Should BeExactly $absoluteUri
|
|
$module.PrivateData.PSData.ProjectUri | Should BeExactly $absoluteUri
|
|
}
|
|
|
|
It "Relative URIs are not allowed" {
|
|
$testUri = [Uri]"../foo"
|
|
|
|
{ New-ModuleManifest -Path $testModulePath -ProjectUri $testUri -LicenseUri $testUri -IconUri $testUri } | ShouldBeErrorId "System.InvalidOperationException,Microsoft.PowerShell.Commands.NewModuleManifestCommand"
|
|
}
|
|
}
|