spec

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 1 Imported by: 0

README ΒΆ

🚝 Spec

Coverage Status

Write readable behavior-driven tests.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

View Source
const (
	DSLGroupKind = DSLKind(0)
	DSLHookKind  = DSLKind(1)
	DSLSpecKind  = DSLKind(2)
)

Variables ΒΆ

This section is empty.

Functions ΒΆ

This section is empty.

Types ΒΆ

type DSL ΒΆ

type DSL struct {
	Kind DSLKind

	Group EngineGroup
	Hook  EngineHook
	Spec  EngineSpec
}

func AfterAll ΒΆ

func AfterAll(fallibles ...Fallible) DSL

func AfterEach ΒΆ

func AfterEach(fallibles ...Fallible) DSL

func BeforeAll ΒΆ

func BeforeAll(fallibles ...Fallible) DSL

func BeforeEach ΒΆ

func BeforeEach(fallibles ...Fallible) DSL

func Context ΒΆ

func Context(title string, body ...DSL) DSL

func Describe ΒΆ

func Describe(title string, body ...DSL) DSL

func Group ΒΆ

func Group(title string, body ...DSL) (ret DSL)

func Hook ΒΆ

func Hook(ba, be, ae, aa bool, fallibles ...Fallible) (ret DSL)

func Inline ΒΆ

func Inline(fallibles ...Fallible) DSL

func It ΒΆ

func It(title string, fallibles ...Fallible) DSL

func Spec ΒΆ

func Spec(title string, fallibles ...Fallible) (ret DSL)

type DSLKind ΒΆ

type DSLKind uint

type EngineGroup ΒΆ

type EngineGroup struct {
	Title string

	Hooks  []EngineHook
	Specs  []EngineSpec
	Groups []EngineGroup
}

func (EngineGroup) Alive ΒΆ

func (it EngineGroup) Alive() bool

func (EngineGroup) Run ΒΆ

func (it EngineGroup) Run(hooks []EngineHook) (ret []error)

type EngineHook ΒΆ

type EngineHook struct {
	Flags struct {
		BeforeAll  bool
		BeforeEach bool
		AfterEach  bool
		AfterAll   bool
	}

	Fallibles []Fallible
}

func (EngineHook) Run ΒΆ

func (it EngineHook) Run() (ret []error)

type EngineSpec ΒΆ

type EngineSpec struct {
	Title     string
	Fallibles []Fallible
}

func (EngineSpec) Alive ΒΆ

func (it EngineSpec) Alive() bool

func (EngineSpec) Run ΒΆ

func (it EngineSpec) Run(hooks []EngineHook) (ret []error)

type EngineSuite ΒΆ

type EngineSuite struct {
	Group EngineGroup
}

func Suite ΒΆ

func Suite(body ...DSL) (ret EngineSuite)

func (EngineSuite) Handle ΒΆ

func (it EngineSuite) Handle(handler Handler)

type Fallible ΒΆ

type Fallible func() error

type Handler ΒΆ

type Handler func(err error)

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

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