HasMessage asserts that the error string matches the expected message.
(expect string)
| 50 | |
| 51 | // HasMessage asserts that the error string matches the expected message. |
| 52 | func (o OnError) HasMessage(expect string) bool { |
| 53 | return o.Compare(o.err.Error(), "has message", expect).Test(o.err != nil && o.err.Error() == expect) |
| 54 | } |
| 55 | |
| 56 | // HasCause asserts that the error cause matches expected error. |
| 57 | func (o OnError) HasCause(expect error) bool { |