mock

package
v0.0.0-...-f0f63f4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mock allows you to return specific values for functions. It will panic if the wrong value types are added.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocker

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

Mocker helps test functions.

func New

func New(enable bool) *Mocker

New creates a Mocker.

func (*Mocker) Add

func (m *Mocker) Add(caller string, arr ...interface{})

Add will append a value.

func (*Mocker) Bool

func (m *Mocker) Bool() (v bool)

Bool .

func (*Mocker) Enabled

func (m *Mocker) Enabled() bool

Enabled returns if the mock is enabled for the function.

func (*Mocker) Error

func (m *Mocker) Error() (v error)

Error .

func (*Mocker) Int

func (m *Mocker) Int() (v int)

Int .

func (*Mocker) SetEnable

func (m *Mocker) SetEnable(enable bool)

SetEnable will enable the mocker.

func (*Mocker) ShowCaller

func (m *Mocker) ShowCaller()

ShowCaller will output the caller.

func (*Mocker) String

func (m *Mocker) String() (v string)

String .

Jump to

Keyboard shortcuts

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