Skip to content

Commit e07d3fa

Browse files
Make Get-SHA512Hash available for use during Pester execution (#153)
89f69f1 introduced the usage of `Get-SHA512Hash` to determine if the Settings.ps1 file had been altered, however that's a non-exported function. This now loads `Helpers.ps1` into the context of the Pester test execution so that the function can be found.
1 parent cd449a1 commit e07d3fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/Common.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function Initialize-CommonTestSetup
3737
. $settingsPath
3838
Import-Module -Name (Join-Path -Path $moduleRootPath -ChildPath 'PowerShellForGitHub.psd1') -Force
3939

40+
# Get-SHA512 is an internal helper function that is not normally exposed.
41+
# We need to explicitly load it into our execution context in order to use it below.
42+
$moduleRootPath = Split-Path -Path $PSScriptRoot -Parent
43+
. (Join-Path -Path $moduleRootPath -ChildPath 'Helpers.ps1')
44+
4045
$originalSettingsHash = (Get-GitHubConfiguration -Name TestConfigSettingsHash)
4146
$currentSettingsHash = Get-SHA512Hash -PlainText (Get-Content -Path $settingsPath -Raw -Encoding Utf8)
4247
$settingsAreUnaltered = $originalSettingsHash -eq $currentSettingsHash

0 commit comments

Comments
 (0)