Skip to content

Commit fe35007

Browse files
Case sensitive names (#254)
* Making the cab file of expected case sensitivity
1 parent e52a6b6 commit fe35007

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/platyPS/platyPS.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,8 @@ function New-ExternalHelpCab
931931
Write-Verbose ("Creating cab for {0}, with Guid {1}, in Locale {2}" -f $ModuleName,$Guid,$Locale)
932932

933933
#Building the cabinet file name.
934-
$cabName = ("{0}_{1}_{2}_helpcontent.cab" -f $ModuleName,$Guid,$Locale)
935-
$zipName = ("{0}_{1}_{2}_helpcontent.zip" -f $ModuleName,$Guid,$Locale)
934+
$cabName = ("{0}_{1}_{2}_HelpContent.cab" -f $ModuleName,$Guid,$Locale)
935+
$zipName = ("{0}_{1}_{2}_HelpContent.zip" -f $ModuleName,$Guid,$Locale)
936936
$zipPath = (Join-Path $OutputFolder $zipName)
937937

938938
#Setting Cab Directives, make a cab is turned on, compression is turned on

test/Pester/FullLoop.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Describe 'Microsoft.PowerShell.Core (SMA) help' {
205205
}
206206

207207
It 'preserve a list in Disconnect-PSSession -OutputBufferingMode' {
208-
$listItemMark = if ($IsMaml) {'- '} else {'-- '}
208+
$listItemMark = '- '
209209
$h = $generatedHelp | ? {$_.Name -eq 'Disconnect-PSSession'}
210210
$param = $h.parameters.parameter | ? {$_.Name -eq 'OutputBufferingMode'}
211211
($param.description | Out-String).Contains("clear.`r`n`r`n`r`n$($listItemMark)Drop. When") | Should Be $true

test/Pester/PlatyPs.Tests.ps1

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -387,24 +387,17 @@ Describe 'New-MarkdownHelp' {
387387

388388

389389
Describe 'New-ExternalHelp' {
390-
function global:Test-OrderFunction {
391-
param ([Parameter(Position=3)]$Third, [Parameter(Position=1)]$First, [Parameter()]$Named)
392-
$First
393-
$Third
394-
$Named
395-
}
396-
397390
BeforeAll {
398-
$a = @{
399-
command = 'Test-OrderFunction'
400-
OutputFolder = 'TestDrive:\'
401-
Force = $true
391+
function global:Test-OrderFunction {
392+
param ([Parameter(Position=3)]$Third, [Parameter(Position=1)]$First, [Parameter()]$Named)
393+
$First
394+
$Third
395+
$Named
402396
}
403-
404-
$file = New-MarkdownHelp @a
405-
$maml = $file | New-ExternalHelp -OutputPath "TestDrive:\TestOrderFunction.xml" -Force
397+
$file = New-MarkdownHelp -Command 'Test-OrderFunction' -OutputFolder $TestDrive -Force
398+
$maml = $file | New-ExternalHelp -OutputPath "$TestDrive\TestOrderFunction.xml" -Force
406399
}
407-
400+
408401
It "generates right order for syntax" {
409402
$help = Get-HelpPreview -Path $maml
410403
($help.Syntax.syntaxItem | measure).Count | Should Be 1
@@ -539,17 +532,17 @@ Describe 'New-ExternalHelpCab' {
539532
It 'validates the output of Cab creation' {
540533

541534
New-ExternalHelpCab -CabFilesFolder $CmdletContentFolder -OutputFolder $OutputPath -LandingPagePath $ModuleMdPageFullPath
542-
$cab = (Get-ChildItem (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_helpcontent.cab")).FullName
535+
$cab = (Get-ChildItem (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.cab")).FullName
543536
$cabExtract = (Join-Path (Split-Path $cab -Parent) "OutXml")
544537

545538
$cabExtract = Join-Path $cabExtract "HelpXml.xml"
546539

547540
expand $cab /f:* $cabExtract
548541

549-
(Get-ChildItem -Filter "*.cab" -Path "$OutputPath").Name | Should Be "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_helpcontent.cab"
542+
(Get-ChildItem -Filter "*.cab" -Path "$OutputPath").Name | Should BeExactly "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.cab"
550543
(Get-ChildItem -Filter "*.xml" -Path "$OutputPath").Name | Should Be "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml"
551544
(Get-ChildItem -Filter "*.xml" -Path "$OutputPath\OutXml").Name | Should Be "HelpXml.xml"
552-
(Get-ChildItem -Filter "*.zip" -Path "$OutputPath").Name | Should Be "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_helpcontent.zip"
545+
(Get-ChildItem -Filter "*.zip" -Path "$OutputPath").Name | Should BeExactly "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.zip"
553546
}
554547

555548
It 'Creates a help info file'{

0 commit comments

Comments
 (0)