mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ClearEventLogDRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/CombinePathCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ContentCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ConvertPathCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/DebugProcessDRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/EventlogCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetEventLogDRTTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetHotFixDRTTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetProcessDRTTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetProviderCommandTest.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetServiceV2DRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/GetWMIObjectTest.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/InvokeWMIMethodTest.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/LimitEventLogDRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/NavigationTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/NewEventLogDRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ParsePathCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/PingComputerDRT.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/PingPathCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ProcessCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/ProcessTaskTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/PropertyCommandTests.cs https://github.com/PowerShell/psl-monad/monad/tests/monad/DRT/commands/management/UnitTests/RemoveEventLogDRTTests.cs
44 lines
2.0 KiB
PowerShell
44 lines
2.0 KiB
PowerShell
Describe "Join-Path cmdlet tests" {
|
|
BeforeAll {
|
|
$StartingLocation = Get-Location
|
|
}
|
|
AfterEach {
|
|
Set-Location $StartingLocation
|
|
}
|
|
It "should output multiple paths when called with multiple -Path targets" -Tag DRT {
|
|
Setup -Dir SubDir1
|
|
(Join-Path -Path TestDrive:,$TestDrive -ChildPath "SubDir1" -resolve).Length | Should be 2
|
|
}
|
|
It "should throw 'Cannot find drive' when drive cannot be found" -Tag DRT {
|
|
{Join-Path bogusdrive:\\somedir otherdir -resolve -ea stop} | Should Throw "Cannot find drive"
|
|
}
|
|
It "should throw 'Cannot find path' when item cannot be found" -Tag DRT {
|
|
{Join-Path "Bogus" "Path" -resolve -ea stop} | Should Throw "Cannot find path"
|
|
}
|
|
#[BugId(BugDatabase.WindowsOutOfBandReleases, 905237)] Note: Windows-specified bug, but the result should be the same on other platforms
|
|
It "should return one object when called with a FileSystem::Redirector" -Tag DRT {
|
|
set-location env:\
|
|
$result=join-path FileSystem::windir system32
|
|
$result.Count | Should be 1
|
|
$result | Should BeExactly "FileSystem::windir\system32"
|
|
}
|
|
#[BugId(BugDatabase.WindowsOutOfBandReleases, 913084)]
|
|
It "should be able to join-path special string 'Variable:' with 'foo'" -Tag DRT {
|
|
$result=Join-Path "Variable:" "foo"
|
|
$result.Count | Should be 1
|
|
$result | Should BeExactly "Variable:\foo"
|
|
}
|
|
#[BugId(BugDatabase.WindowsOutOfBandReleases, 913084)]
|
|
It "should be able to join-path special string 'Alias:' with 'foo'" -Tag DRT {
|
|
$result=Join-Path "Alias:" "foo"
|
|
$result.Count | Should be 1
|
|
$result | Should BeExactly "Alias:\foo"
|
|
}
|
|
#[BugId(BugDatabase.WindowsOutOfBandReleases, 913084)]
|
|
It "should be able to join-path special string 'Env:' with 'foo'" -Tag DRT {
|
|
$result=Join-Path "Env:" "foo"
|
|
$result.Count | Should be 1
|
|
$result | Should BeExactly "Env:\foo"
|
|
}
|
|
}
|