Documentation ¶
Index ¶
- Variables
- func ClockFromContext(ctx context.Context) clockwork.FakeClock
- func CompareAsJSON(first, second io.Reader) (bool, error)
- func ConfigureTracer(m *testing.M)
- func FilterInteraction(i *cassette.Interaction) error
- func IsCIRun() bool
- func LookupStringI(i interface{}, path string) (reflect.Value, 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 SecurePath(path string) string
- func SetClock(path string) (clockwork.FakeClock, error)
- 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 ¶
var ErrNotFound = errors.New("Unable to find the key")
ErrNotFound is returned when the key didn't match
Functions ¶
func ClockFromContext ¶
ClockFromContext returns clock or panics.
func CompareAsJSON ¶
CompareAsJSON returns true if JSON strings serialize into same values.
func FilterInteraction ¶
func FilterInteraction(i *cassette.Interaction) error
FilterInteraction removes secret arguments from the URL.
func IsCIRun ¶
func IsCIRun() bool
IsCIRun returns true if the CI environment variable is set to "true"
func LookupStringI ¶
LookupStringI returnes the value found at the given path
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 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.
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 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