package internal
import "github.com/onsi/gomega/internal"
Index ¶
- Constants
- Variables
- type Assertion
- func NewAssertion(actualInput any, g *Gomega, offset int, extra ...any) *Assertion
- func (assertion *Assertion) Error() types.Assertion
- func (assertion *Assertion) NotTo(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *Assertion) Should(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *Assertion) ShouldNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *Assertion) To(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *Assertion) ToNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *Assertion) WithOffset(offset int) types.Assertion
- type AsyncAssertion
- func NewAsyncAssertion(asyncType AsyncAssertionType, actualInput any, g *Gomega, timeoutInterval time.Duration, pollingInterval time.Duration, mustPassRepeatedly int, ctx context.Context, offset int) *AsyncAssertion
- func (assertion *AsyncAssertion) MustPassRepeatedly(count int) types.AsyncAssertion
- func (assertion *AsyncAssertion) NotTo(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *AsyncAssertion) ProbeEvery(interval time.Duration) types.AsyncAssertion
- func (assertion *AsyncAssertion) Should(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *AsyncAssertion) ShouldNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *AsyncAssertion) To(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *AsyncAssertion) ToNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
- func (assertion *AsyncAssertion) WithArguments(argsToForward ...any) types.AsyncAssertion
- func (assertion *AsyncAssertion) WithContext(ctx context.Context) types.AsyncAssertion
- func (assertion *AsyncAssertion) WithOffset(offset int) types.AsyncAssertion
- func (assertion *AsyncAssertion) WithPolling(interval time.Duration) types.AsyncAssertion
- func (assertion *AsyncAssertion) WithTimeout(interval time.Duration) types.AsyncAssertion
- func (assertion *AsyncAssertion) Within(timeout time.Duration) types.AsyncAssertion
- type AsyncAssertionType
- type DurationBundle
- type Gomega
- func NewGomega(bundle DurationBundle) *Gomega
- func (g *Gomega) ConfigureWithFailHandler(fail types.GomegaFailHandler) *Gomega
- func (g *Gomega) ConfigureWithT(t types.GomegaTestingT) *Gomega
- func (g *Gomega) Consistently(actualOrCtx any, args ...any) types.AsyncAssertion
- func (g *Gomega) ConsistentlyWithOffset(offset int, actualOrCtx any, args ...any) types.AsyncAssertion
- func (g *Gomega) DisableDefaultTimeoutsWhenUsingContext()
- func (g *Gomega) EnforceDefaultTimeoutsWhenUsingContexts()
- func (g *Gomega) Eventually(actualOrCtx any, args ...any) types.AsyncAssertion
- func (g *Gomega) EventuallyWithOffset(offset int, actualOrCtx any, args ...any) types.AsyncAssertion
- func (g *Gomega) Expect(actual any, extra ...any) types.Assertion
- func (g *Gomega) ExpectWithOffset(offset int, actual any, extra ...any) types.Assertion
- func (g *Gomega) IsConfigured() bool
- func (g *Gomega) SetDefaultConsistentlyDuration(t time.Duration)
- func (g *Gomega) SetDefaultConsistentlyPollingInterval(t time.Duration)
- func (g *Gomega) SetDefaultEventuallyPollingInterval(t time.Duration)
- func (g *Gomega) SetDefaultEventuallyTimeout(t time.Duration)
- func (g *Gomega) Ω(actual any, extra ...any) types.Assertion
- type PollingSignalError
- type PollingSignalErrorAttachment
- type PollingSignalErrorImpl
- func AsPollingSignalError(actual any) (*PollingSignalErrorImpl, bool)
- func (s *PollingSignalErrorImpl) Attach(description string, obj any) PollingSignalError
- func (s *PollingSignalErrorImpl) Error() string
- func (s *PollingSignalErrorImpl) IsStopTrying() bool
- func (s *PollingSignalErrorImpl) IsSuccessful() bool
- func (s *PollingSignalErrorImpl) IsTryAgainAfter() bool
- func (s *PollingSignalErrorImpl) Now()
- func (s *PollingSignalErrorImpl) Successfully() PollingSignalError
- func (s *PollingSignalErrorImpl) TryAgainDuration() time.Duration
- func (s *PollingSignalErrorImpl) Unwrap() error
- func (s *PollingSignalErrorImpl) Wrap(err error) PollingSignalError
- type PollingSignalErrorType
Constants ¶
const ( EventuallyTimeoutEnvVarName = "GOMEGA_DEFAULT_EVENTUALLY_TIMEOUT" EventuallyPollingIntervalEnvVarName = "GOMEGA_DEFAULT_EVENTUALLY_POLLING_INTERVAL" ConsistentlyDurationEnvVarName = "GOMEGA_DEFAULT_CONSISTENTLY_DURATION" ConsistentlyPollingIntervalEnvVarName = "GOMEGA_DEFAULT_CONSISTENTLY_POLLING_INTERVAL" EnforceDefaultTimeoutsWhenUsingContextsEnvVarName = "GOMEGA_ENFORCE_DEFAULT_TIMEOUTS_WHEN_USING_CONTEXTS" )
Variables ¶
var StopTrying = func(message string) PollingSignalError { return &PollingSignalErrorImpl{ message: message, pollingSignalErrorType: PollingSignalErrorTypeStopTrying, } }
var TryAgainAfter = func(duration time.Duration) PollingSignalError { return &PollingSignalErrorImpl{ message: fmt.Sprintf("told to try again after %s", duration), duration: duration, pollingSignalErrorType: PollingSignalErrorTypeTryAgainAfter, } }
Types ¶
type Assertion ¶
type Assertion struct {
// contains filtered or unexported fields
}
func NewAssertion ¶
func (*Assertion) Error ¶
func (*Assertion) NotTo ¶
func (assertion *Assertion) NotTo(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*Assertion) Should ¶
func (assertion *Assertion) Should(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*Assertion) ShouldNot ¶
func (assertion *Assertion) ShouldNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*Assertion) To ¶
func (assertion *Assertion) To(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*Assertion) ToNot ¶
func (assertion *Assertion) ToNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*Assertion) WithOffset ¶
type AsyncAssertion ¶
type AsyncAssertion struct {
// contains filtered or unexported fields
}
func NewAsyncAssertion ¶
func NewAsyncAssertion(asyncType AsyncAssertionType, actualInput any, g *Gomega, timeoutInterval time.Duration, pollingInterval time.Duration, mustPassRepeatedly int, ctx context.Context, offset int) *AsyncAssertion
func (*AsyncAssertion) MustPassRepeatedly ¶
func (assertion *AsyncAssertion) MustPassRepeatedly(count int) types.AsyncAssertion
func (*AsyncAssertion) NotTo ¶
func (assertion *AsyncAssertion) NotTo(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*AsyncAssertion) ProbeEvery ¶
func (assertion *AsyncAssertion) ProbeEvery(interval time.Duration) types.AsyncAssertion
func (*AsyncAssertion) Should ¶
func (assertion *AsyncAssertion) Should(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*AsyncAssertion) ShouldNot ¶
func (assertion *AsyncAssertion) ShouldNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*AsyncAssertion) To ¶
func (assertion *AsyncAssertion) To(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*AsyncAssertion) ToNot ¶
func (assertion *AsyncAssertion) ToNot(matcher types.GomegaMatcher, optionalDescription ...any) bool
func (*AsyncAssertion) WithArguments ¶
func (assertion *AsyncAssertion) WithArguments(argsToForward ...any) types.AsyncAssertion
func (*AsyncAssertion) WithContext ¶
func (assertion *AsyncAssertion) WithContext(ctx context.Context) types.AsyncAssertion
func (*AsyncAssertion) WithOffset ¶
func (assertion *AsyncAssertion) WithOffset(offset int) types.AsyncAssertion
func (*AsyncAssertion) WithPolling ¶
func (assertion *AsyncAssertion) WithPolling(interval time.Duration) types.AsyncAssertion
func (*AsyncAssertion) WithTimeout ¶
func (assertion *AsyncAssertion) WithTimeout(interval time.Duration) types.AsyncAssertion
func (*AsyncAssertion) Within ¶
func (assertion *AsyncAssertion) Within(timeout time.Duration) types.AsyncAssertion
type AsyncAssertionType ¶
type AsyncAssertionType uint
const ( AsyncAssertionTypeEventually AsyncAssertionType = iota AsyncAssertionTypeConsistently )
func (AsyncAssertionType) String ¶
func (at AsyncAssertionType) String() string
type DurationBundle ¶
type DurationBundle struct { EventuallyTimeout time.Duration EventuallyPollingInterval time.Duration ConsistentlyDuration time.Duration ConsistentlyPollingInterval time.Duration EnforceDefaultTimeoutsWhenUsingContexts bool }
func FetchDefaultDurationBundle ¶
func FetchDefaultDurationBundle() DurationBundle
type Gomega ¶
type Gomega struct { Fail types.GomegaFailHandler THelper func() DurationBundle DurationBundle }
func NewGomega ¶
func NewGomega(bundle DurationBundle) *Gomega
func (*Gomega) ConfigureWithFailHandler ¶
func (g *Gomega) ConfigureWithFailHandler(fail types.GomegaFailHandler) *Gomega
func (*Gomega) ConfigureWithT ¶
func (g *Gomega) ConfigureWithT(t types.GomegaTestingT) *Gomega
func (*Gomega) Consistently ¶
func (g *Gomega) Consistently(actualOrCtx any, args ...any) types.AsyncAssertion
func (*Gomega) ConsistentlyWithOffset ¶
func (g *Gomega) ConsistentlyWithOffset(offset int, actualOrCtx any, args ...any) types.AsyncAssertion
func (*Gomega) DisableDefaultTimeoutsWhenUsingContext ¶
func (g *Gomega) DisableDefaultTimeoutsWhenUsingContext()
func (*Gomega) EnforceDefaultTimeoutsWhenUsingContexts ¶
func (g *Gomega) EnforceDefaultTimeoutsWhenUsingContexts()
func (*Gomega) Eventually ¶
func (g *Gomega) Eventually(actualOrCtx any, args ...any) types.AsyncAssertion
func (*Gomega) EventuallyWithOffset ¶
func (g *Gomega) EventuallyWithOffset(offset int, actualOrCtx any, args ...any) types.AsyncAssertion
func (*Gomega) Expect ¶
func (*Gomega) ExpectWithOffset ¶
func (*Gomega) IsConfigured ¶
func (*Gomega) SetDefaultConsistentlyDuration ¶
func (*Gomega) SetDefaultConsistentlyPollingInterval ¶
func (*Gomega) SetDefaultEventuallyPollingInterval ¶
func (*Gomega) SetDefaultEventuallyTimeout ¶
func (*Gomega) Ω ¶
type PollingSignalError ¶
type PollingSignalError interface { error Wrap(err error) PollingSignalError Attach(description string, obj any) PollingSignalError Successfully() PollingSignalError Now() }
type PollingSignalErrorAttachment ¶
type PollingSignalErrorImpl ¶
type PollingSignalErrorImpl struct { Attachments []PollingSignalErrorAttachment // contains filtered or unexported fields }
func AsPollingSignalError ¶
func AsPollingSignalError(actual any) (*PollingSignalErrorImpl, bool)
func (*PollingSignalErrorImpl) Attach ¶
func (s *PollingSignalErrorImpl) Attach(description string, obj any) PollingSignalError
func (*PollingSignalErrorImpl) Error ¶
func (s *PollingSignalErrorImpl) Error() string
func (*PollingSignalErrorImpl) IsStopTrying ¶
func (s *PollingSignalErrorImpl) IsStopTrying() bool
func (*PollingSignalErrorImpl) IsSuccessful ¶
func (s *PollingSignalErrorImpl) IsSuccessful() bool
func (*PollingSignalErrorImpl) IsTryAgainAfter ¶
func (s *PollingSignalErrorImpl) IsTryAgainAfter() bool
func (*PollingSignalErrorImpl) Now ¶
func (s *PollingSignalErrorImpl) Now()
func (*PollingSignalErrorImpl) Successfully ¶
func (s *PollingSignalErrorImpl) Successfully() PollingSignalError
func (*PollingSignalErrorImpl) TryAgainDuration ¶
func (s *PollingSignalErrorImpl) TryAgainDuration() time.Duration
func (*PollingSignalErrorImpl) Unwrap ¶
func (s *PollingSignalErrorImpl) Unwrap() error
func (*PollingSignalErrorImpl) Wrap ¶
func (s *PollingSignalErrorImpl) Wrap(err error) PollingSignalError
type PollingSignalErrorType ¶
type PollingSignalErrorType int
const ( PollingSignalErrorTypeStopTrying PollingSignalErrorType = iota PollingSignalErrorTypeTryAgainAfter )
Source Files ¶
assertion.go async_assertion.go duration_bundle.go gomega.go polling_signal_error.go vetoptdesc.go
Directories ¶
Path | Synopsis |
---|---|
internal/gutil | Package gutil is a replacement for ioutil, which should not be used in new code as of Go 1.16. |
internal/testingtsupport |
- Version
- v1.37.0 (latest)
- Published
- Apr 2, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 3 hours ago –
Tools for package owners.