Documentation
¶
Index ¶
- func ClockFromContext(ctx context.Context) clockwork.FakeClock
- func ConfigureSteps(s *gobdd.Suite)
- func ConfigureTracer(m *testing.M)
- func FilterInteraction(i *cassette.Interaction) error
- func GetCleanup(ctx gobdd.Context) map[string]func()
- func GetCtx(ctx gobdd.Context) context.Context
- func GetData(ctx gobdd.Context) map[string]interface{}
- func GetRequestArguments(ctx gobdd.Context) []interface{}
- func GetRequestParameters(ctx gobdd.Context) map[string]interface{}
- func IsCIRun() bool
- func MatchInteraction(r *http.Request, i cassette.Request) bool
- func ReadFixture(path string) (string, error)
- func Recorder(ctx context.Context, name string) (*recorder.Recorder, error)
- func RestoreClock(path string) (clockwork.FakeClock, error)
- func Retry(interval time.Duration, count int, call func() bool) error
- func RunCleanup(ctx gobdd.Context)
- func SecurePath(path string) string
- func SetAPI(ctx gobdd.Context, value interface{})
- func SetCleanup(ctx gobdd.Context, value map[string]func())
- func SetClock(path string) (clockwork.FakeClock, error)
- func SetCtx(ctx gobdd.Context, value context.Context)
- func SetData(ctx gobdd.Context, value map[string]interface{})
- func Templated(data interface{}, source string) string
- func UniqueEntityName(ctx context.Context, t *testing.T) *string
- func WithClock(ctx context.Context, path string) (context.Context, error)
- func WithTestSpan(ctx context.Context, t *testing.T) (context.Context, func())
- func WithUniqueSurrounding(ctx context.Context, name string) string
- func WrapRoundTripper(rt http.RoundTripper, opts ...ddhttp.RoundTripperOption) http.RoundTripper
- type Assertions
- type RecordingMode
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClockFromContext ¶
ClockFromContext returns clock or panics.
func FilterInteraction ¶
func FilterInteraction(i *cassette.Interaction) error
FilterInteraction removes secret arguments from the URL.
func GetRequestArguments ¶
GetRequestArguments helps to build a request.
func GetRequestParameters ¶
GetRequestParameters helps to build a request.
func IsCIRun ¶
func IsCIRun() bool
IsCIRun returns true if the CI environment variable is set to "true"
func MatchInteraction ¶
MatchInteraction checks if the request matches a store request in the given cassette.
func ReadFixture ¶
ReadFixture opens the file at path and returns the contents as a string
func RestoreClock ¶
RestoreClock restore current time from .freeze file.
func RunCleanup ¶
RunCleanup executes cleanup functions in controlled ordered based on registered keys.
func SecurePath ¶
SecurePath replaces all dangerous characters in the path.
func UniqueEntityName ¶
UniqueEntityName will return a unique string that can be used as a title/description/summary/... of an API entity. When used in Azure Pipelines and RECORD=true or RECORD=none, it will include BuildId to enable mapping resources that weren't deleted to builds.
func WithTestSpan ¶
WithTestSpan starts new span with test information.
func WithUniqueSurrounding ¶
WithUniqueSurrounding will wrap a string that can be used as a title/description/summary/... of an API entity. When used in Azure Pipelines and RECORD=true or RECORD=none, it will include BuildId to enable mapping resources that weren't deleted to builds.
func WrapRoundTripper ¶
func WrapRoundTripper(rt http.RoundTripper, opts ...ddhttp.RoundTripperOption) http.RoundTripper
WrapRoundTripper includes tracing information.
Types ¶
type RecordingMode ¶
type RecordingMode string
RecordingMode defines valid usage of cassette recorder
const ( ModeIgnore RecordingMode = "none" ModeReplaying RecordingMode = "false" ModeRecording RecordingMode = "true" )
Valid usage modes for cassette recorder
func GetRecording ¶
func GetRecording() RecordingMode
GetRecording returns the value of RECORD environment variable