Update documentation for the Error function in assert or require package
Summary
Incorrect assert.Error() docs
Changes
Removing the if statement and the Equal call from the example.
Motivation
Since we already have EqualError, the documentation is trying to use assert.Equal to assert the error object's content.
Related issues
Closes #1609
The change now hides that
Errorreturns a boolean that can be used for further checks.I think that we must keep the if statement around in the usage example.
This change is in accordance with the below conversation by @brackendawson
https://github.com/stretchr/testify/issues/1609#issuecomment-2402331089
@architagr I'd like to get this merged but I can't in good faith dismiss @dolmen's review because this PR still removes the last reference to assert's functions returning a bool. Can you add a paragraph to assert/doc.go which explains that all assertions return a bool indicating if the assertion passed? Then I think we can merge this change.
@architagr I'd like to get this merged but I can't in good faith dismiss @dolmen's review because this PR still removes the last reference to assert's functions returning a bool. Can you add a paragraph to assert/doc.go which explains that all assertions return a bool indicating if the assertion passed? Then I think we can merge this change.
Sure I can do that
@architagr I'd like to get this merged but I can't in good faith dismiss @dolmen's review because this PR still removes the last reference to assert's functions returning a bool. Can you add a paragraph to assert/doc.go which explains that all assertions return a bool indicating if the assertion passed? Then I think we can merge this change.
Hi @brackendawson, I have updated the doc.go, can you please have a look if that looks ok.