6 "github.com/onsi/gomega/format"
9 type SucceedMatcher struct {
12 func (matcher *SucceedMatcher) Match(actual interface{}) (success bool, err error) {
18 // must be an 'error' type
20 return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1))
23 // must be nil (or a pointer to a nil)
24 return isNil(actual), nil
27 func (matcher *SucceedMatcher) FailureMessage(actual interface{}) (message string) {
28 return fmt.Sprintf("Expected success, but got an error:\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1))
31 func (matcher *SucceedMatcher) NegatedFailureMessage(actual interface{}) (message string) {
32 return "Expected failure, but got no error."