mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make Measure-Object property test independent of the filesystem (#15879)
This commit is contained in:
@@ -64,10 +64,13 @@ Describe "Measure-Object" -Tags "CI" {
|
||||
}
|
||||
|
||||
It "Should be able to count using the Property switch" {
|
||||
$expected = $(Get-ChildItem $TestDrive).Length
|
||||
$actual = $(Get-ChildItem $TestDrive | Measure-Object -Property Length).Count
|
||||
$items = @(
|
||||
[pscustomobject]@{ X = 'a'; Y = 'b' }
|
||||
[pscustomobject]@{ X = 'c' }
|
||||
[pscustomobject]@{ X = 'e'; Y = 'f' }
|
||||
)
|
||||
|
||||
$actual | Should -Be $expected
|
||||
($items | Measure-Object -Property Y).Count | Should -Be 2
|
||||
}
|
||||
|
||||
It "Should be able to use wildcards for the Property argument" {
|
||||
|
||||
Reference in New Issue
Block a user