mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
New-Item tests to use Should Match
This commit is contained in:
1 parent
4a4df0f080
commit
7c6a0ce2f1
1 file changed
+2
-3
@@ -111,9 +111,8 @@ Describe "New-Item" {
|
|||||||
New-Item -ItemType SymbolicLink -Target $FullyQualifiedFile -Name $testlink -Path $tmpDirectory
|
New-Item -ItemType SymbolicLink -Target $FullyQualifiedFile -Name $testlink -Path $tmpDirectory
|
||||||
Test-Path $FullyQualifiedLink | Should Be $true
|
Test-Path $FullyQualifiedLink | Should Be $true
|
||||||
|
|
||||||
$target = $FullyQualifiedFile
|
|
||||||
$fileInfo = Get-ChildItem $FullyQualifiedLink
|
$fileInfo = Get-ChildItem $FullyQualifiedLink
|
||||||
$fileInfo.Target | Should Be $target
|
$fileInfo.Target | Should Match $FullyQualifiedFile
|
||||||
$fileInfo.LinkType | Should Be "SymbolicLink"
|
$fileInfo.LinkType | Should Be "SymbolicLink"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +135,7 @@ Describe "New-Item" {
|
|||||||
Test-Path $FullyQualifiedLink | Should Be $true
|
Test-Path $FullyQualifiedLink | Should Be $true
|
||||||
|
|
||||||
$fileInfo = Get-ChildItem $FullyQualifiedLink
|
$fileInfo = Get-ChildItem $FullyQualifiedLink
|
||||||
$fileInfo.Target | Should Be $FullyQualifiedFolder
|
$fileInfo.Target | Should Match $FullyQualifiedFolder
|
||||||
$fileInfo.LinkType | Should Be "SymbolicLink"
|
$fileInfo.LinkType | Should Be "SymbolicLink"
|
||||||
|
|
||||||
# Remove the link explicitly to avoid broken symlink issue
|
# Remove the link explicitly to avoid broken symlink issue
|
||||||
|
|||||||
Reference in new issue
Block a user