Skip to content

Commit

Permalink
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
Browse files Browse the repository at this point in the history
…test names
  • Loading branch information
vicperdana committed Aug 21, 2024
1 parent 525fb0b commit 2f84991
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/PSDocs.Tests/PSDocs.Common.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ Describe 'Get-PSDocument' -Tag 'Cmdlet', 'Common', 'Get-PSDocument' {
BeforeAll {
$testModuleSourcePath = Join-Path $here -ChildPath 'TestModule';
$Null = Import-Module $testModuleSourcePath -Force;
$result = @(Get-PSDocument -Module 'TestModule');
$currentLoadingPreference = Get-Variable -Name PSModuleAutoLoadingPreference -ErrorAction SilentlyContinue -ValueOnly;
}
It 'Returns documents' {
$result = @(Get-PSDocument -Module 'TestModule');
$currentLoadingPreference = Get-Variable -Name PSModuleAutoLoadingPreference -ErrorAction SilentlyContinue -ValueOnly;
$result | Should -Not -BeNullOrEmpty;
$result.Length | Should -Be 2;
$result.Id | Should -BeIn 'TestModule\TestDocument1', 'TestModule\TestDocument2';
Expand Down Expand Up @@ -342,12 +342,13 @@ Describe 'Get-PSDocumentHeader' -Tag 'Cmdlet', 'Common', 'Get-PSDocumentHeader'
$testObject = [PSCustomObject]@{
Name = 'TestObject'
}
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
OutputPath = $outputPath
}
}
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
OutputPath = $outputPath
}

It 'Get Metadata header' {
$result = Invoke-PSDocument @invokeParams -Name 'WithMetadata';
$result = Get-PSDocumentHeader -Path $outputPath;
Expand Down

0 comments on commit 2f84991

Please sign in to comment.