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{})
| 275 | // actualObj, err := SomeFunction() |
| 276 | // a.ErrorContains(err, expectedErrorSubString) |
| 277 | func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool { |
| 278 | if h, ok := a.t.(tHelper); ok { |
| 279 | h.Helper() |
| 280 | } |
| 281 | return ErrorContains(a.t, theError, contains, msgAndArgs...) |
| 282 | } |
| 283 | |
| 284 | // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) |
| 285 | // and that the error contains the specified substring. |