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 GetIgnoredTags() []string
- func GetJSONResponse(ctx gobdd.Context) interface{}
- func GetRequestArguments(ctx gobdd.Context) []interface{}
- func GetRequestParameters(ctx gobdd.Context) map[string]interface{}
- func GetRequestsUndo(ctx gobdd.Context, operationID string) (func([]reflect.Value) func(), error)
- func GetResponse(ctx gobdd.Context) []reflect.Value
- func GetResponseStatusCode(resp []reflect.Value) (int, error)
- func GetT(ctx gobdd.Context) *testing.T
- func IsCIRun() bool
- func LoadRequestsUndo(file string) (map[string]UndoAction, error)
- 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 SetClient(ctx gobdd.Context, value interface{})
- 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 SetFixtureData(ctx gobdd.Context)
- func SetRequestsUndo(ctx gobdd.Context, value map[string]UndoAction)
- func SnakeToCamelCase(snake string) (camel string)
- func Templated(t gobdd.StepTest, 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 GivenStep
- type RecordingMode
- type TestingT
- type UndoAction
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 GetJSONResponse ¶
GetJSONResponse returns request response.
func GetRequestArguments ¶
GetRequestArguments helps to build a request.
func GetRequestParameters ¶
GetRequestParameters helps to build a request.
func GetRequestsUndo ¶
GetRequestsUndo gets map with undo function for each request.
func GetResponse ¶
GetResponse returns request response.
func GetResponseStatusCode ¶
GetResponseStatusCode returns request response status code.
func IsCIRun ¶
func IsCIRun() bool
IsCIRun returns true if the CI environment variable is set to "true"
func LoadRequestsUndo ¶
func LoadRequestsUndo(file string) (map[string]UndoAction, error)
LoadRequestsUndo load undo configuration.
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 SetFixtureData ¶
SetFixtureData sets the fixture data in BDD context
func SetRequestsUndo ¶
func SetRequestsUndo(ctx gobdd.Context, value map[string]UndoAction)
SetRequestsUndo sets map with undo function for each request.
func SnakeToCamelCase ¶
SnakeToCamelCase converts snake_case to SnakeCase.
func UniqueEntityName ¶
UniqueEntityName will return a unique string that can be used as a title/description/summary/... of an API entity.
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.
func WrapRoundTripper ¶
func WrapRoundTripper(rt http.RoundTripper, opts ...ddhttp.RoundTripperOption) http.RoundTripper
WrapRoundTripper includes tracing information.
Types ¶
type GivenStep ¶
type GivenStep struct { Tag string `json:"tag"` Key string `json:"key"` Step string `json:"step"` OperationID string `json:"operationId"` Parameters []operationParameter `json:"parameters"` Source *string `json:"source"` }
GivenStep defines a step.
func LoadGivenSteps ¶
LoadGivenSteps load undo configuration.
func (GivenStep) RegisterSuite ¶
RegisterSuite adds step implementation.
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