mock

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnyValue represents const for any value in tests
	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
}

ModuleMock represents module mock

func New

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

New creates new ModuleMock

func (*ModuleMock) Clean

func (m *ModuleMock) Clean()

Clean the registry and errors

func (*ModuleMock) GetLoader

func (m *ModuleMock) GetLoader(_ modules.Job) lua.LGFunction

GetLoader returns lua loader

func (*ModuleMock) Name

func (m *ModuleMock) Name() string

Name returns the module name

func (*ModuleMock) Result

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

Result returns test results

func (*ModuleMock) Stop

func (m *ModuleMock) Stop() error

Stop the module

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
}

Registry is an interface for registry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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