ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring. actualObj, err := SomeFunction() a.ErrorContains(err, expectedErrorSubString)
(theError error, contains string, msgAndArgs ...interface{})
| 259 | // actualObj, err := SomeFunction() |
| 260 | // a.ErrorContains(err, expectedErrorSubString) |
| 261 | func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool { |
| 262 | if h, ok := a.t.(tHelper); ok { |
| 263 | h.Helper() |
| 264 | } |
| 265 | return ErrorContains(a.t, theError, contains, msgAndArgs...) |
| 266 | } |
| 267 | |
| 268 | // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) |
| 269 | // and that the error contains the specified substring. |