forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewModuleManifest.Tests.ps1
More file actions
28 lines (23 loc) · 1.22 KB
/
Copy pathNewModuleManifest.Tests.ps1
File metadata and controls
28 lines (23 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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"
}
}