features

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 20

Documentation

Overview

Package features hosts types that are used to define a feature tests and other related types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterStepsByName

func FilterStepsByName(steps []types.Step, regexName *regexp.Regexp) []types.Step

func GetStepsByLevel

func GetStepsByLevel(steps []types.Step, l types.Level) []types.Step

Types

type Feature

type Feature = types.Feature

type FeatureBuilder

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

FeatureBuilder represents is a type to define a testable feature

func New

func New(name string) *FeatureBuilder

func NewWithDescription added in v0.3.0

func NewWithDescription(name, description string) *FeatureBuilder

func (*FeatureBuilder) Assess

func (b *FeatureBuilder) Assess(desc string, fn Func) *FeatureBuilder

Assess adds an assessment step to the feature test.

func (*FeatureBuilder) AssessWithDescription added in v0.3.0

func (b *FeatureBuilder) AssessWithDescription(name, description string, fn Func) *FeatureBuilder

func (*FeatureBuilder) Feature

func (b *FeatureBuilder) Feature() types.Feature

Feature returns a feature configured by builder.

func (*FeatureBuilder) Setup

func (b *FeatureBuilder) Setup(fn Func) *FeatureBuilder

Setup adds a new setup step that will be applied prior to feature test.

func (*FeatureBuilder) Teardown

func (b *FeatureBuilder) Teardown(fn Func) *FeatureBuilder

Teardown adds a new teardown step that will be applied after feature test.

func (*FeatureBuilder) WithLabel

func (b *FeatureBuilder) WithLabel(key, value string) *FeatureBuilder

WithLabel adds a test label key/value pair

func (*FeatureBuilder) WithSetup added in v0.0.7

func (b *FeatureBuilder) WithSetup(name string, fn Func) *FeatureBuilder

WithSetup adds a new setup step with a pre-defined setup name instead of automating the setup name generation. This can make tests more readable.

func (*FeatureBuilder) WithStep added in v0.0.4

func (b *FeatureBuilder) WithStep(name string, level Level, fn Func) *FeatureBuilder

WithStep adds a new step that will be applied prior to feature test.

func (*FeatureBuilder) WithStepDescription added in v0.3.0

func (b *FeatureBuilder) WithStepDescription(name, description string, level Level, fn Func) *FeatureBuilder

func (*FeatureBuilder) WithTeardown added in v0.0.7

func (b *FeatureBuilder) WithTeardown(name string, fn Func) *FeatureBuilder

WithTeardown adds a new teardown step with a pre-defined name instead of an auto-generated one

type Func

type Func = types.StepFunc

type Labels

type Labels = types.Labels

type Level

type Level = types.Level

type Step

type Step = types.Step

type Table added in v0.0.5

type Table []struct {
	Name        string
	Description string
	Assessment  Func
}

Table provides a structure for table-driven tests. Each entry in the table represents an executable assessment.

func (Table) Build added in v0.0.5

func (table Table) Build(args ...string) *FeatureBuilder

Build converts the defined test steps in the table into a FeatureBuilder which can be used to add additional attributes to the feature before it's exercised. Build takes an optional feature name if omitted will be generated.

Jump to

Keyboard shortcuts

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