Skip to content

Commit

Permalink
Fix test to call -replace correctly
Browse files Browse the repository at this point in the history
johlju committed Aug 23, 2024

Verified

This commit was signed with the committer’s verified signature.
johlju Johan Ljunggren
1 parent 07b06b4 commit d73995a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tst/functions/assertions/PesterThrow.Tests.ps1
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ InPesterModuleScope {

It "returns the correct assertion message when message filter is used and contain escaped wildcard character" {
$err = { { throw [ArgumentException]"[!]" } | Should -Throw -ExpectedMessage '`[`]' } | Verify-AssertionFailed
$err.Exception.Message | Verify-Equal "Expected an exception with message like '[]' to be thrown, but the message was '[!]'. from ##path##:1 char:" -replace "##path##", $testScriptPath
$err.Exception.Message | Verify-Equal ("Expected an exception with message like '[]' to be thrown, but the message was '[!]'. from ##path##:1 char:" -replace "##path##", $testScriptPath)
}

It 'returns the correct assertion message when exceptions messages differ' {

0 comments on commit d73995a

Please sign in to comment.