...
1
2
3 package gstruct
4
5 import (
6 "github.com/onsi/gomega/types"
7 )
8
9
10
11
12 func Ignore() types.GomegaMatcher {
13 return &IgnoreMatcher{true}
14 }
15
16
17
18
19
20 func Reject() types.GomegaMatcher {
21 return &IgnoreMatcher{false}
22 }
23
24
25 type IgnoreMatcher struct {
26 Succeed bool
27 }
28
29 func (m *IgnoreMatcher) Match(actual interface{}) (bool, error) {
30 return m.Succeed, nil
31 }
32
33 func (m *IgnoreMatcher) FailureMessage(_ interface{}) (message string) {
34 return "Unconditional failure"
35 }
36
37 func (m *IgnoreMatcher) NegatedFailureMessage(_ interface{}) (message string) {
38 return "Unconditional success"
39 }
40
View as plain text