spechelper

package
v0.108.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ErrIDRequired errorutil.Error = `` /* 174-byte string literal not displayed */

Variables

View Source
var ContextVar = testcase.Var[context.Context]{
	ID: "context.Context",
	Init: func(t *testcase.T) context.Context {
		return context.Background()
	},
}
View Source
var (
	SubscriberFilter = testcase.Var[func(interface{}) bool]{
		ID: `subscriber event filter`,
		Init: func(t *testcase.T) func(interface{}) bool {
			return func(interface{}) bool { return true }
		},
	}
)

Functions

func DeleteSubscriptionFilter added in v0.71.0

func DeleteSubscriptionFilter[ID any](event interface{}) bool

func GenEntities added in v0.71.0

func GenEntities[T any](t *testcase.T, MakeEntity func(testing.TB) T) []*T

func LetSubscriber added in v0.71.0

func LetSubscriber[Entity, ID any](s *testcase.Spec, filter func(interface{}) bool) testcase.Var[*eventSubscriber[Entity, ID]]

func LetSubscription added in v0.71.0

func LetSubscription[Entity, ID any](s *testcase.Spec) testcase.Var[pubsub.Subscription]

func NewEventSubscriber added in v0.71.0

func NewEventSubscriber[Entity, ID any](tb testing.TB, filter func(interface{}) bool) *eventSubscriber[Entity, ID]

func TryCleanup added in v0.80.0

func TryCleanup(tb testing.TB, ctx context.Context, resource any) bool

func UpdateSubscriptionFilter added in v0.71.0

func UpdateSubscriptionFilter[Entity any](event interface{}) bool

Types

type CRD added in v0.71.0

type CRD[Entity, ID any] interface {
	crud.Creator[Entity]
	crud.ByIDFinder[Entity, ID]
	crud.ByIDDeleter[ID]
}

CRD is the minimum requirements to write easily behavioral specification for a resource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL