Skip to content

Commit

Permalink
Merge pull request #24 from theohbrothers/fix/tests-fix-some-unit-tes…
Browse files Browse the repository at this point in the history
…ts-to-use-pester-v4-syntax

Fix (tests): Fix some unit tests to use Pester v4 syntax
  • Loading branch information
leojonathanoh authored Jul 18, 2021
2 parents 440a796 + fb63662 commit 3b55ec3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Get-DuplicateItem/public/Get-DuplicateItem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ Describe "Get-DuplicateItem" -Tag 'Unit' {
It 'Shows error when Path does not exist' {
Get-DuplicateItem -Path $invalidPath -ErrorVariable err -ErrorAction Continue 2>$null

$err.Count | Should Not Be 0
$err.Count | Should -Not -Be 0
}

It 'Shows error when LiteralPath does not exist' {
Get-DuplicateItem -LiteralPath $invalidPath -ErrorVariable err -ErrorAction Continue 2>$null

$err.Count | Should Not Be 0
$err.Count | Should -Not -Be 0
}

It 'Shows error when pipeline object is not a string' {
$invalidPathCollection = @( @( "foo", "bar") )
$invalidPathCollection | Get-DuplicateItem -ErrorVariable err -ErrorAction Continue 2>$null

$err.Count | Should Not Be 0
$err.Count | Should -Not -Be 0
}

It 'Shows error when pipeline object is not an existing Path' {
$invalidPath | Get-DuplicateItem -ErrorVariable err -ErrorAction Continue 2>$null

$err.Count | Should Not Be 0
$err.Count | Should -Not -Be 0
}

}
Expand Down Expand Up @@ -66,26 +66,26 @@ Describe "Get-DuplicateItem" -Tag 'Unit' {
It 'Remains silent when Path does not exist' {
$err = Get-DuplicateItem -Path $invalidPath -ErrorVariable err -ErrorAction SilentlyContinue

$err | Should Be $null
$err | Should -Be $null
}

It 'Remains silent when LiteralPath does not exist' {
$err = Get-DuplicateItem -Path $invalidPath -ErrorVariable err -ErrorAction SilentlyContinue

$err | Should Be $null
$err | Should -Be $null
}

It 'Remains silent when pipeline object is not a string' {
$invalidPathCollection = @( @( "foo", "bar") )
$err = $invalidPathCollection | Get-DuplicateItem -ErrorVariable err -ErrorAction SilentlyContinue

$err | Should Be $null
$err | Should -Be $null
}

It 'Remains silent when pipeline object is not an existing Path' {
$err = $invalidPath | Get-DuplicateItem -ErrorVariable err -ErrorAction SilentlyContinue

$err | Should Be $null
$err | Should -Be $null
}

}
Expand Down

0 comments on commit 3b55ec3

Please sign in to comment.