Skip to content

Commit

Permalink
AsyncAssertions emit the format.Object representation of the error wh…
Browse files Browse the repository at this point in the history
…en it is not a PolilngSignalError
  • Loading branch information
onsi committed Oct 26, 2022
1 parent d63d67e commit 818b78c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/async_assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch
message += format.Object(attachment.Object, 1)
}
} else {
message = "Error: " + err.Error()
message = "Error: " + err.Error() + "\n" + format.Object(err, 1)
}
} else {
if desiredMatch {
Expand Down
11 changes: 10 additions & 1 deletion internal/async_assertion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1228,10 +1228,19 @@ sprocket:
widget:
<string>: bob
sprocket:
<int>: 17`))
<int>: 17`))

})
})

Context("when a non-PollingSignalError is in play", func() {
It("also includes the format.Object representation", func() {
ig.G.Eventually(func() (int, error) {
return 0, fmt.Errorf("bam")
}).WithTimeout(10 * time.Millisecond).Should(Equal(1))
Ω(ig.FailureMessage).Should(ContainSubstring("*fmt.wrapError"))
})
})
})

Describe("The StopTrying signal - when sent by the matcher", func() {
Expand Down

0 comments on commit 818b78c

Please sign in to comment.