(actual interface{})
| 31 | } |
| 32 | |
| 33 | func (matcher *MatchErrorMatcher) Match(actual interface{}) (bool, error) { |
| 34 | error, ok := actual.(*goext.Error) |
| 35 | if !ok { |
| 36 | return false, fmt.Errorf("ErrorMatcher matcher expects an Error") |
| 37 | } |
| 38 | return error.Err.Error() == matcher.Expected.Err.Error() && error.Status == matcher.Expected.Status, nil |
| 39 | } |
| 40 | |
| 41 | func (matcher *MatchErrorMatcher) FailureMessage(actual interface{}) (message string) { |
| 42 | return fmt.Sprintf("Expected\n\t%#v\nto be\n\t%#v", actual, matcher.Expected) |
no test coverage detected