fxtesting

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GodogRunner

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

GodogRunner acts as a wrapper around Godog allowing to maintain a global acceptance test state.

func NewGodogRunner

func NewGodogRunner(opts ...GodogRunnerOption) *GodogRunner

NewGodogRunner returns a new Godog runner.

func (*GodogRunner) RegisterFeatureContext

func (r *GodogRunner) RegisterFeatureContext(ctx func(s *godog.Suite))

RegisterFeatureContext registers a feature context

func (*GodogRunner) RegisterFeaturePath

func (r *GodogRunner) RegisterFeaturePath(featurePath string)

RegisterFeaturePath registers a path where .feature files can be found.

func (*GodogRunner) Run

func (r *GodogRunner) Run() int

type GodogRunnerOption

type GodogRunnerOption func(*GodogRunner)

GodogRunnerOption sets an option on the Godog runner.

func WithGodogOptions

func WithGodogOptions(o godog.Options) GodogRunnerOption

WithGodogOptions sets Godog options on the runner.

func WithSuiteName

func WithSuiteName(s string) GodogRunnerOption

WithSuiteName sets Godog suite name on the runner.

type Runner

type Runner interface {
	// Run executes the tests and returns with an exit code.
	Run() int
}

Runner is the interface responsible for running tests implemented by testing.M.

func AppendRunner

func AppendRunner(target Runner, runners ...Runner) Runner

AppendRunner checks if the target runner is already a runner list and appends the runner to it. Otherwise it creates a runner list and appends both runners to it.

type RunnerFactory

type RunnerFactory interface {
	// CreateRunner creates a test runner.
	CreateRunner() (Runner, error)
}

RunnerFactory creates a new runner.

type RunnerFactoryFunc

type RunnerFactoryFunc func() (Runner, error)

RunnerFactoryFunc wraps a function implementing the RunnerFactory interface.

func (RunnerFactoryFunc) CreateRunner

func (fn RunnerFactoryFunc) CreateRunner() (Runner, error)

type RunnerFactoryRegistry

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

RunnerFactoryRegistry accepts runner factory implementations and creates a runner list from them.

func (*RunnerFactoryRegistry) CreateRunner

func (r *RunnerFactoryRegistry) CreateRunner() (Runner, error)

CreateRunner creates test runners from the underlying factories.

func (*RunnerFactoryRegistry) Register

func (r *RunnerFactoryRegistry) Register(factory RunnerFactory)

Register appends a runner factory to the list. It is safe to call this method from multiple goroutines if necessary.

type Runners

type Runners []Runner

Runners is a list of test runners.

func (Runners) Run

func (r Runners) Run() int

Run executes the underlying runners and returns the highest exit code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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