From fb636620b52d0619804deff4077fd8a951bb3ff0 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 18 Jul 2021 03:20:50 +0000 Subject: [PATCH] Fix (tests): Fix some unit tests to use Pester v4 syntax --- .../public/Get-DuplicateItem.Tests.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Get-DuplicateItem/public/Get-DuplicateItem.Tests.ps1 b/src/Get-DuplicateItem/public/Get-DuplicateItem.Tests.ps1 index 534e26e..3d74f61 100644 --- a/src/Get-DuplicateItem/public/Get-DuplicateItem.Tests.ps1 +++ b/src/Get-DuplicateItem/public/Get-DuplicateItem.Tests.ps1 @@ -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 } } @@ -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 } }