dsl

package
v0.0.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookBefore = "before"
	HookAfter  = "after"
)
View Source
const (
	ArgDefault = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

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

func DecodeArg

func DecodeArg(b *hcl.Block) (*Arg, errors.Error)

DecodeArg decode bock arg.

func (*Arg) Execute

func (a *Arg) Execute(ctx context.FeatureContext) errors.Error

type Args

type Args []*Arg

type Body

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

type Feature

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

Feature list of scenarios.

func DecodeFeature

func DecodeFeature(body hcl.Body) (*Feature, errors.Error)

func (*Feature) AddScenario

func (feature *Feature) AddScenario(scenario *Scenario)

func (*Feature) AfterHooksByTag

func (feature *Feature) AfterHooksByTag(tags []string) []*Hook

func (*Feature) BeforeHooksByTag

func (feature *Feature) BeforeHooksByTag(tags []string) []*Hook

func (*Feature) Description

func (feature *Feature) Description() string

func (*Feature) Includes

func (feature *Feature) Includes() Includes

func (*Feature) Input

func (feature *Feature) Input() *Input

func (*Feature) Join

func (feature *Feature) Join(include *Feature)

func (*Feature) LoadVariables

func (feature *Feature) LoadVariables(ctx context.FeatureContext) errors.Error

func (*Feature) Path

func (feature *Feature) Path() string

func (*Feature) Scenarios

func (feature *Feature) Scenarios() []*Scenario

func (*Feature) SetPath

func (feature *Feature) SetPath(path string)

func (*Feature) Vars

func (feature *Feature) Vars() Vars

type Func

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

type Functions

type Functions map[string]*Func

type Given

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

Given represents the stage in a schemaScenario in which the preconditions must be declared and the data are initialized.

func (Given) Description

func (s Given) Description() string

func (Given) Name

func (s Given) Name() string

func (Given) SetDescription

func (s Given) SetDescription(description string)

func (Given) SetName

func (s Given) SetName(name string)

func (Given) String

func (s Given) String() string

func (Given) TotalActions

func (s Given) TotalActions() int

type Hook

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

func (*Hook) Execute

func (h *Hook) Execute(ctx context.FeatureContext) errors.Error

func (*Hook) String

func (h *Hook) String() string

func (*Hook) TotalActions

func (h *Hook) TotalActions() int

type Hooks

type Hooks map[string]*Hook

type Include

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

func (*Include) IsFile

func (i *Include) IsFile() bool

func (*Include) Path

func (i *Include) Path() string

type Includes

type Includes []*Include

type Input

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

Input represents the list of variables to be provided.

func (*Input) AddArg

func (i *Input) AddArg(arg *Arg)

AddArg add a new arg to the lis tof arguments.

func (*Input) Execute

func (i *Input) Execute(ctx context.FeatureContext) errors.Error

func (*Input) TotalArgs

func (i *Input) TotalArgs() int

TotalArgs return the number of defined tags in the block.

type Return

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

type Scenario

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

Scenario represents a single schemaScenario to be tested. A schemaScenario is composed by the Given-Block-Then blocks.

func (*Scenario) ContinueOnError

func (s *Scenario) ContinueOnError(ctx *hcl.EvalContext) bool

func (*Scenario) Examples

func (s *Scenario) Examples(ctx context.FeatureContext) ([]map[string]cty.Value, errors.Error)

func (*Scenario) Execute

func (s *Scenario) Execute(ctx context.FeatureContext) errors.Error

func (*Scenario) IsIgnored

func (s *Scenario) IsIgnored(ctx *hcl.EvalContext) bool

func (*Scenario) Sections

func (s *Scenario) Sections() Sections

func (*Scenario) String

func (s *Scenario) String() string

func (*Scenario) Tags

func (s *Scenario) Tags() []string

func (*Scenario) Validate

func (s *Scenario) Validate() errors.Error

type Section

type Section interface {
	Name() string
	String() string
	SetName(name string)

	TotalActions() int
	// contains filtered or unexported methods
}

type Sections

type Sections []Section

type Then

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

Then represents the stage in a schemaScenario in which the assertions take place.

func (Then) Description

func (s Then) Description() string

func (Then) Name

func (s Then) Name() string

func (Then) SetDescription

func (s Then) SetDescription(description string)

func (Then) SetName

func (s Then) SetName(name string)

func (Then) String

func (s Then) String() string

func (Then) TotalActions

func (s Then) TotalActions() int

type Vars

type Vars hcl.Attributes

func (Vars) Append

func (vars Vars) Append(newVars Vars)

func (Vars) To

func (vars Vars) To(current map[string]cty.Value) errors.Error

type VarsList

type VarsList []Vars

type When

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

When represents the stage in a schemaScenario in which we perform the actions or actions to be tested.

func (When) Description

func (s When) Description() string

func (When) Name

func (s When) Name() string

func (When) SetDescription

func (s When) SetDescription(description string)

func (When) SetName

func (s When) SetName(name string)

func (When) String

func (s When) String() string

func (When) TotalActions

func (s When) TotalActions() int

Jump to

Keyboard shortcuts

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