fixtures

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidInstance indicates that an object instance was expected but
	// did not matched expected types.
	ErrInvalidInstance = fixtures.ErrInvalidInstance

	// ErrUnknown indicates that an error does not exists
	ErrUnknown = fixtures.ErrUnknown

	// ErrUnsupportedFixture indicates provided fixture kind
	// is not supported.
	ErrUnsupportedFixture = fixtures.ErrUnsupportedFixture
)

Functions

This section is empty.

Types

type Fixtures

type Fixtures struct {
	// contains filtered or unexported fields
}

Fixtures manages fixtures files to help data initialisation for test.

It relies on picker.Picker manager.

func New

func New(pickerInstance *picker.Picker) *Fixtures

New initiates a fixtures manager instance using provided picker. It relies on a singleton pattern so successive call to New will return the same instance.

func (*Fixtures) BeforeScenarioTagLoader

func (fix *Fixtures) BeforeScenarioTagLoader(s *godog.Scenario)

BeforeScenarioTagLoader initialize the TagLoader for fixture. It allows to pass a `@manifest` tag to load fixture manifest

@manifest:fixture/example.yml

func (Fixtures) Debug

func (Fixtures) Debug() error

Debug start debug logs for picker. It will be removed when calling Reset.

func (Fixtures) DisableDebug

func (Fixtures) DisableDebug() error

DisableDebug stops debugging.

func (Fixtures) Load

func (fix Fixtures) Load(fixturePath string, instancePickedKey string) error

Load loads fixtures using provided Kind and path. Parameter instancePickedKey is required for some Kind.

func (Fixtures) LoadManifest

func (fix Fixtures) LoadManifest(manifestPath string) error

LoadManifest loads Manifest from path.

func (Fixtures) Reset

func (fix Fixtures) Reset()

Reset resets fixture instance.

func (*Fixtures) WithBasePath

func (fix *Fixtures) WithBasePath(path string) *Fixtures

WithBasePath add a path element as prefix for any fixture file path.

Jump to

Keyboard shortcuts

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