mock

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnyValue = "__TEST_ANY_VALUE__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ModuleMock

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

func New

func New(name string, methods []string, logger *zap.Logger) *ModuleMock

func (*ModuleMock) Clean

func (m *ModuleMock) Clean()

func (*ModuleMock) GetLoader

func (m *ModuleMock) GetLoader(_ *script.Script) lua.LGFunction

func (*ModuleMock) Name

func (m *ModuleMock) Name() string

func (*ModuleMock) Result

func (m *ModuleMock) Result() ([]modules.TestResult, error)

func (*ModuleMock) Stop

func (m *ModuleMock) Stop() error

type Registry added in v0.5.0

type Registry interface {
	Clean()
	Register(AnyValue, method string, callArgs, retArgs []lua.LValue) error
	Response(AnyValue, method string, args []lua.LValue) ([]lua.LValue, error)
	AddAssert(method string, args []lua.LValue, called bool) error
	AddCall(method string, args []lua.LValue) error
	Result() []modules.TestResult
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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