From 628105389a71c3fb3e02f26dfefacb16d80aea3f Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Wed, 31 Jul 2024 20:26:16 +0200 Subject: [PATCH] Fix integ test --- .../Integration/Syntax/v5/ShouldBeLike.v5.tests.ps1 | 12 +++++++++--- .../Syntax/v5/ShouldBeLikeExactly.v5.tests.ps1 | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/Integration/Syntax/v5/ShouldBeLike.v5.tests.ps1 b/tests/Integration/Syntax/v5/ShouldBeLike.v5.tests.ps1 index 64f20b0..a625851 100644 --- a/tests/Integration/Syntax/v5/ShouldBeLike.v5.tests.ps1 +++ b/tests/Integration/Syntax/v5/ShouldBeLike.v5.tests.ps1 @@ -63,9 +63,15 @@ Describe 'Should -BeLike' { Should -BeLike 'Test*' 'mock should test correct value' 'TestValue' } - It 'Should convert `Should ''Test*'' ''mock should test correct value'' ''TestValue'' -BeLike` correctly' { - Should 'Test*' 'mock should test correct value' 'TestValue' -BeLike - } + <# + This was not supported in Pester 5.6.1. There it gave the error message: + + RuntimeException: Legacy Should syntax (without dashes) is not supported in Pester 5.Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4 + ParameterBindingException: Cannot retrieve the dynamic parameters for the cmdlet. Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4 + #> + # It 'Should convert `Should ''Test*'' ''mock should test correct value'' ''TestValue'' -BeLike` correctly' { + # Should 'Test*' 'mock should test correct value' 'TestValue' -BeLike + # } } Context 'When the tests are negated' { diff --git a/tests/Integration/Syntax/v5/ShouldBeLikeExactly.v5.tests.ps1 b/tests/Integration/Syntax/v5/ShouldBeLikeExactly.v5.tests.ps1 index 13ae0cf..8e90b86 100644 --- a/tests/Integration/Syntax/v5/ShouldBeLikeExactly.v5.tests.ps1 +++ b/tests/Integration/Syntax/v5/ShouldBeLikeExactly.v5.tests.ps1 @@ -63,9 +63,15 @@ Describe 'Should -BeLikeExactly' { Should -BeLikeExactly 'Test*' 'mock should test correct value' 'TestValue' } - It 'Should convert `Should ''Test*'' ''mock should test correct value'' ''TestValue'' -BeLikeExactly` correctly' { - Should 'Test*' 'mock should test correct value' 'TestValue' -BeLikeExactly - } + <# + This was not supported in Pester 5.6.1. There it gave the error message: + + RuntimeException: Legacy Should syntax (without dashes) is not supported in Pester 5.Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4 + ParameterBindingException: Cannot retrieve the dynamic parameters for the cmdlet. Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4 + #> + # It 'Should convert `Should ''Test*'' ''mock should test correct value'' ''TestValue'' -BeLikeExactly` correctly' { + # Should 'Test*' 'mock should test correct value' 'TestValue' -BeLikeExactly + # } } Context 'When the tests are negated' {