Documentation ¶
Index ¶
- func Call(text string, does func(context.Context, Mock)) call
- func DescribePaths(nodes ...node) []string
- func NewControllerSuite(ginkgoT ginkgo.FullGinkgoTInterface, clients ...mock.MockClient) *ctlrSuite
- func NewSuite(t *testing.T, clients ...mock.MockClient) *standardSuite
- func Once(text string, does func(context.Context, Mock)) once
- func OneOf(nodes ...allOf) oneOf
- func Path(nodes ...node) allOf
- func Result(text string, does func(context.Context, Mock)) result
- type Mock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribePaths ¶
func DescribePaths(nodes ...node) []string
DescribePaths computes all permutations for the given nodes and returns a slice of strings describing each permutation.
func NewControllerSuite ¶
func NewControllerSuite(ginkgoT ginkgo.FullGinkgoTInterface, clients ...mock.MockClient) *ctlrSuite
NewControllerSuite creates a test suite for a controller. It generates new mock clients for each test path it runs.
func NewSuite ¶
func NewSuite(t *testing.T, clients ...mock.MockClient) *standardSuite
NewSuite creates a test suite using Go's standard testing library. It generates new mock clients for each test path it runs.
func Once ¶
Once declares a function that runs one time when executing all test paths. It is triggered at the beginning of the leftmost test path where it is inserted.
func OneOf ¶
func OneOf(nodes ...allOf) oneOf
OneOf declares multiple nodes that fork out into unique test paths.
Types ¶
type Mock ¶
type Mock struct { gomock.TestReporter mock.MockClients // contains filtered or unexported fields }
Mock holds configuration for a single test path.
func (*Mock) Events ¶
Events returns a string of all events currently recorded during path evaluation.
func (*Mock) Logger ¶
Logger returns a logr.Logger for capturing logs written during a reconcile loop. Log output can be read as a single string by calling Logs().
func (*Mock) Logs ¶
Logs returns a string of all log outputs currently written during path evaluation.
func (*Mock) Recorder ¶
func (m *Mock) Recorder() *record.FakeRecorder
Recorder returns a *FakeRecorder for recording events published in a reconcile loop. Events can be consumed as a single string by calling Events().