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