mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Change 'Platform.XDG_Type' and 'Platform.SelectProductNameForDirectory' back to 'public'
Add CI tests for the module path change
This commit is contained in:
1 parent
753b202a75
commit
8bb291896c
2 files changed
+34
-2
No files matched your search
@@ -207,7 +207,7 @@ namespace System.Management.Automation
|
||||
/// <summary>
|
||||
/// X Desktop Group configuration type enum.
|
||||
/// </summary>
|
||||
internal enum XDG_Type
|
||||
public enum XDG_Type
|
||||
{
|
||||
/// <summary> XDG_CONFIG_HOME/powershell </summary>
|
||||
CONFIG,
|
||||
@@ -226,7 +226,7 @@ namespace System.Management.Automation
|
||||
/// <summary>
|
||||
/// function for choosing directory location of PowerShell for profile loading
|
||||
/// </summary>
|
||||
internal static string SelectProductNameForDirectory(Platform.XDG_Type dirpath)
|
||||
public static string SelectProductNameForDirectory(Platform.XDG_Type dirpath)
|
||||
{
|
||||
//TODO: XDG_DATA_DIRS implementation as per GitHub issue #1060
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
Describe "Module Path Basic Tests" -tags "CI" {
|
||||
|
||||
It "validate module path on windows" -Skip:(!$IsWindows) {
|
||||
|
||||
$paths = $env:PSModulePath -split [System.IO.Path]::PathSeparator
|
||||
$paths.Count | Should Be 3
|
||||
|
||||
$expectedUserPath = Join-Path -Path $HOME -ChildPath 'Documents\PowerShell\Modules'
|
||||
$paths[0] | Should Be $expectedUserPath
|
||||
|
||||
$expectedSharedPath = Join-Path -Path $env:ProgramFiles -ChildPath 'PowerShell\Modules'
|
||||
$paths[1] | Should Be $expectedSharedPath
|
||||
|
||||
$expectedSystemPath = Join-Path -Path $PSHOME -ChildPath 'Modules'
|
||||
$paths[2] | Should Be $expectedSystemPath
|
||||
}
|
||||
|
||||
It "validate module path on unix" -Skip:($IsWindows) {
|
||||
|
||||
$paths = $env:PSModulePath -split [System.IO.Path]::PathSeparator
|
||||
$paths.Count | Should Be 3
|
||||
|
||||
$expectedUserPath = [System.Management.Automation.Platform]::SelectProductNameForDirectory("USER_MODULES")
|
||||
$paths[0] | Should Be $expectedUserPath
|
||||
|
||||
$expectedSharedPath = [System.Management.Automation.Platform]::SelectProductNameForDirectory("SHARED_MODULES")
|
||||
$paths[1] | Should Be $expectedSharedPath
|
||||
|
||||
$expectedSystemPath = Join-Path -Path $PSHOME -ChildPath 'Modules'
|
||||
$paths[2] | Should Be $expectedSystemPath
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user