...
1 package types
2
3 import (
4 "context"
5 "time"
6 )
7
8 type GomegaFailHandler func(message string, callerSkip ...int)
9
10
11 type GomegaTestingT interface {
12 Helper()
13 Fatalf(format string, args ...interface{})
14 }
15
16
17 type Gomega interface {
18 Ω(actual interface{}, extra ...interface{}) Assertion
19 Expect(actual interface{}, extra ...interface{}) Assertion
20 ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Assertion
21
22 Eventually(actualOrCtx interface{}, args ...interface{}) AsyncAssertion
23 EventuallyWithOffset(offset int, actualOrCtx interface{}, args ...interface{}) AsyncAssertion
24
25 Consistently(actualOrCtx interface{}, args ...interface{}) AsyncAssertion
26 ConsistentlyWithOffset(offset int, actualOrCtx interface{}, args ...interface{}) AsyncAssertion
27
28 SetDefaultEventuallyTimeout(time.Duration)
29 SetDefaultEventuallyPollingInterval(time.Duration)
30 SetDefaultConsistentlyDuration(time.Duration)
31 SetDefaultConsistentlyPollingInterval(time.Duration)
32 }
33
34
35
36
37 type GomegaMatcher interface {
38 Match(actual interface{}) (success bool, err error)
39 FailureMessage(actual interface{}) (message string)
40 NegatedFailureMessage(actual interface{}) (message string)
41 }
42
43
52 type OracleMatcher interface {
53 MatchMayChangeInTheFuture(actual interface{}) bool
54 }
55
56 func MatchMayChangeInTheFuture(matcher GomegaMatcher, value interface{}) bool {
57 oracleMatcher, ok := matcher.(OracleMatcher)
58 if !ok {
59 return true
60 }
61
62 return oracleMatcher.MatchMayChangeInTheFuture(value)
63 }
64
65
66
67 type AsyncAssertion interface {
68 Should(matcher GomegaMatcher, optionalDescription ...interface{}) bool
69 ShouldNot(matcher GomegaMatcher, optionalDescription ...interface{}) bool
70
71 WithOffset(offset int) AsyncAssertion
72 WithTimeout(interval time.Duration) AsyncAssertion
73 WithPolling(interval time.Duration) AsyncAssertion
74 Within(timeout time.Duration) AsyncAssertion
75 ProbeEvery(interval time.Duration) AsyncAssertion
76 WithContext(ctx context.Context) AsyncAssertion
77 WithArguments(argsToForward ...interface{}) AsyncAssertion
78 MustPassRepeatedly(count int) AsyncAssertion
79 }
80
81
82 type Assertion interface {
83 Should(matcher GomegaMatcher, optionalDescription ...interface{}) bool
84 ShouldNot(matcher GomegaMatcher, optionalDescription ...interface{}) bool
85
86 To(matcher GomegaMatcher, optionalDescription ...interface{}) bool
87 ToNot(matcher GomegaMatcher, optionalDescription ...interface{}) bool
88 NotTo(matcher GomegaMatcher, optionalDescription ...interface{}) bool
89
90 WithOffset(offset int) Assertion
91
92 Error() Assertion
93 }
94
View as plain text