mock4go: github.com/jvshahid/mock4go Index | Files | Directories

package api

import "github.com/jvshahid/mock4go"

Index

Package Files

api.go instrument.go utils.go

Constants

const Mock4goImport = "github.com/jvshahid/mock4go"

Variables

var Map = make(map[function][]*functionCall)

func AddMock4goImport Uses

func AddMock4goImport(f *ast.File)

func FunctionCalled Uses

func FunctionCalled(fun function, args ...interface{}) ([]interface{}, bool, error)

Returns the (return values, true, nil) if the method/function is mocked and the args match the expected values. Otherwise, it returns (nil, true, nil) if there was an error this function returns (nil, false, error)

func GetPackage Uses

func GetPackage(packageName string) (*build.Package, error)

func InstrumentFile Uses

func InstrumentFile(fileName string) (string, error)

func InstrumentFunctionsAndInterfaces Uses

func InstrumentFunctionsAndInterfaces(f *ast.File) bool

func InstrumentPackage Uses

func InstrumentPackage(packageName string, tmpDir string) (*build.Package, error)

func InstrumentPackageRecur Uses

func InstrumentPackageRecur(pkg *build.Package, tmpDir string, instrumented map[string]bool) (err error)

func Log Uses

func Log(msg string, args ...interface{})

func Mock Uses

func Mock(fun func())

func ResetMocks Uses

func ResetMocks()

func SetVerbosity Uses

func SetVerbosity(isVerbose bool)

func When Uses

func When(args ...interface{}) *functionCall

func ZeroValues Uses

func ZeroValues(fun function) []interface{}

type DeepEqualMatcher Uses

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

func (*DeepEqualMatcher) Matches Uses

func (m *DeepEqualMatcher) Matches(other interface{}) bool

type EqualsMatcher Uses

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

func (*EqualsMatcher) Matches Uses

func (m *EqualsMatcher) Matches(other interface{}) bool

type Interface Uses

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

type Matcher Uses

type Matcher interface {
    Matches(interface{}) bool
}

Directories

PathSynopsis
mock4go

Package api imports 12 packages (graph) and is imported by 1 packages. Updated 2016-07-19. Refresh now. Tools for package owners.