pegomock: github.com/petergtz/pegomock Index | Files | Directories

package pegomock

import "github.com/petergtz/pegomock"

Index

Package Files

dsl.go invocation_count_matchers.go matcher.go matcher_factories.go testing_t_support.go types.go

func AnyBool Uses

func AnyBool() bool

func AnyBoolSlice Uses

func AnyBoolSlice() []bool

func AnyComplex128 Uses

func AnyComplex128() complex128

func AnyComplex128Slice Uses

func AnyComplex128Slice() []complex128

func AnyComplex64 Uses

func AnyComplex64() complex64

func AnyComplex64Slice Uses

func AnyComplex64Slice() []complex64

func AnyFloat32 Uses

func AnyFloat32() float32

func AnyFloat32Slice Uses

func AnyFloat32Slice() []float32

func AnyFloat64 Uses

func AnyFloat64() float64

func AnyFloat64Slice Uses

func AnyFloat64Slice() []float64

func AnyInt Uses

func AnyInt() int

func AnyInt16 Uses

func AnyInt16() int16

func AnyInt16Slice Uses

func AnyInt16Slice() []int16

func AnyInt32 Uses

func AnyInt32() int32

func AnyInt32Slice Uses

func AnyInt32Slice() []int32

func AnyInt64 Uses

func AnyInt64() int64

func AnyInt64Slice Uses

func AnyInt64Slice() []int64

func AnyInt8 Uses

func AnyInt8() int8

func AnyInt8Slice Uses

func AnyInt8Slice() []int8

func AnyIntSlice Uses

func AnyIntSlice() []int

func AnyInterface Uses

func AnyInterface() interface{}

func AnyInterfaceSlice Uses

func AnyInterfaceSlice() []interface{}

func AnyString Uses

func AnyString() string

func AnyStringSlice Uses

func AnyStringSlice() []string

func AnyUint Uses

func AnyUint() uint

func AnyUint16 Uses

func AnyUint16() uint16

func AnyUint16Slice Uses

func AnyUint16Slice() []uint16

func AnyUint32 Uses

func AnyUint32() uint32

func AnyUint32Slice Uses

func AnyUint32Slice() []uint32

func AnyUint64 Uses

func AnyUint64() uint64

func AnyUint64Slice Uses

func AnyUint64Slice() []uint64

func AnyUint8 Uses

func AnyUint8() uint8

func AnyUint8Slice Uses

func AnyUint8Slice() []uint8

func AnyUintSlice Uses

func AnyUintSlice() []uint

func AnyUintptr Uses

func AnyUintptr() uintptr

func AnyUintptrSlice Uses

func AnyUintptrSlice() []uintptr

func DumpInvocationsFor Uses

func DumpInvocationsFor(mock Mock)

func EqBool Uses

func EqBool(value bool) bool

func EqComplex128 Uses

func EqComplex128(value complex128) complex128

func EqComplex64 Uses

func EqComplex64(value complex64) complex64

func EqFloat32 Uses

func EqFloat32(value float32) float32

func EqFloat64 Uses

func EqFloat64(value float64) float64

func EqInt Uses

func EqInt(value int) int

func EqInt16 Uses

func EqInt16(value int16) int16

func EqInt32 Uses

func EqInt32(value int32) int32

func EqInt64 Uses

func EqInt64(value int64) int64

func EqInt8 Uses

func EqInt8(value int8) int8

func EqInterface Uses

func EqInterface(value interface{}) interface{}

func EqString Uses

func EqString(value string) string

func EqUint Uses

func EqUint(value uint) uint

func EqUint16 Uses

func EqUint16(value uint16) uint16

func EqUint32 Uses

func EqUint32(value uint32) uint32

func EqUint64 Uses

func EqUint64(value uint64) uint64

func EqUint8 Uses

func EqUint8(value uint8) uint8

func EqUintptr Uses

func EqUintptr(value uintptr) uintptr

func InterceptMockFailures Uses

func InterceptMockFailures(f func()) []string

InterceptMockFailures runs a given callback and returns an array of failure messages generated by any Pegomock verifications within the callback.

This is accomplished by temporarily replacing the *global* fail handler with a fail handler that simply annotates failures. The original fail handler is reset when InterceptMockFailures returns.

func RegisterMatcher Uses

func RegisterMatcher(matcher Matcher)

func RegisterMockFailHandler Uses

func RegisterMockFailHandler(handler FailHandler)

func RegisterMockTestingT Uses

func RegisterMockTestingT(t *testing.T)

func SDumpInvocationsFor Uses

func SDumpInvocationsFor(mock Mock) string

func When Uses

func When(invocation ...interface{}) *ongoingStubbing

type AnyMatcher Uses

type AnyMatcher struct {
    Type reflect.Type

    sync.Mutex
    // contains filtered or unexported fields
}

func NewAnyMatcher Uses

func NewAnyMatcher(typ reflect.Type) *AnyMatcher

func (*AnyMatcher) FailureMessage Uses

func (matcher *AnyMatcher) FailureMessage() string

func (*AnyMatcher) Matches Uses

func (matcher *AnyMatcher) Matches(param Param) bool

func (*AnyMatcher) String Uses

func (matcher *AnyMatcher) String() string

type AtLeastIntMatcher Uses

type AtLeastIntMatcher struct {
    Value int
    // contains filtered or unexported fields
}

func AtLeast Uses

func AtLeast(numDesiredInvocations int) *AtLeastIntMatcher

func (*AtLeastIntMatcher) FailureMessage Uses

func (matcher *AtLeastIntMatcher) FailureMessage() string

func (*AtLeastIntMatcher) Matches Uses

func (matcher *AtLeastIntMatcher) Matches(param Param) bool

func (*AtLeastIntMatcher) String Uses

func (matcher *AtLeastIntMatcher) String() string

type AtMostIntMatcher Uses

type AtMostIntMatcher struct {
    Value int
    // contains filtered or unexported fields
}

func AtMost Uses

func AtMost(numDesiredInvocations int) *AtMostIntMatcher

func (*AtMostIntMatcher) FailureMessage Uses

func (matcher *AtMostIntMatcher) FailureMessage() string

func (*AtMostIntMatcher) Matches Uses

func (matcher *AtMostIntMatcher) Matches(param Param) bool

func (*AtMostIntMatcher) String Uses

func (matcher *AtMostIntMatcher) String() string

type Counter Uses

type Counter struct {
    sync.Mutex
    // contains filtered or unexported fields
}

type EqMatcher Uses

type EqMatcher struct {
    Value Param

    sync.Mutex
    // contains filtered or unexported fields
}

func Never Uses

func Never() *EqMatcher

func Once Uses

func Once() *EqMatcher

func Times Uses

func Times(numDesiredInvocations int) *EqMatcher

func Twice Uses

func Twice() *EqMatcher

func (*EqMatcher) FailureMessage Uses

func (matcher *EqMatcher) FailureMessage() string

func (*EqMatcher) Matches Uses

func (matcher *EqMatcher) Matches(param Param) bool

func (*EqMatcher) String Uses

func (matcher *EqMatcher) String() string

type FailHandler Uses

type FailHandler func(message string, callerSkip ...int)
var GlobalFailHandler FailHandler

func BuildTestingTFailHandler Uses

func BuildTestingTFailHandler(t testingT) FailHandler

type GenericMock Uses

type GenericMock struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func GetGenericMockFrom Uses

func GetGenericMockFrom(mock Mock) *GenericMock

func (*GenericMock) GetInvocationParams Uses

func (genericMock *GenericMock) GetInvocationParams(methodInvocations []MethodInvocation) [][]Param

TODO this doesn't need to be a method, can be a free function

func (*GenericMock) Invoke Uses

func (genericMock *GenericMock) Invoke(methodName string, params []Param, returnTypes []reflect.Type) ReturnValues

func (*GenericMock) Verify Uses

func (genericMock *GenericMock) Verify(
    inOrderContext *InOrderContext,
    invocationCountMatcher Matcher,
    methodName string,
    params []Param,
    options ...interface{},
) []MethodInvocation

type InOrderContext Uses

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

type Matcher Uses

type Matcher interface {
    Matches(param Param) bool
    FailureMessage() string
    fmt.Stringer
}

Matcher ... it is guaranteed that FailureMessage will always be called after Matches so an implementation can save state

type Matchers Uses

type Matchers []Matcher

func (Matchers) Matches Uses

func (matchers Matchers) Matches(params []Param) bool

type MethodInvocation Uses

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

type Mock Uses

type Mock interface {
    SetFailHandler(FailHandler)
    FailHandler() FailHandler
}

type Option Uses

type Option interface{ Apply(Mock) }

func WithFailHandler Uses

func WithFailHandler(fail FailHandler) Option

func WithT Uses

func WithT(t testingT) Option

type OptionFunc Uses

type OptionFunc func(mock Mock)

func (OptionFunc) Apply Uses

func (f OptionFunc) Apply(mock Mock)

type Param Uses

type Param interface{}

type ReturnValue Uses

type ReturnValue interface{}

type ReturnValues Uses

type ReturnValues []ReturnValue

type Stubbing Uses

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

func (*Stubbing) Invoke Uses

func (stubbing *Stubbing) Invoke(params []Param) ReturnValues

type Stubbings Uses

type Stubbings []*Stubbing

Directories

PathSynopsis
ginkgo_compatible
internal/generate_matchers
internal/verify
matchersCode generated by pegomock.
mockgenMockGen generates mock implementations of Go interfaces.
mockgen/util
modelPackage model contains the data model necessary for generating mock implementations.
modelgen/gomock
modelgen/loader
pegomock
pegomock/filehandling
pegomock/remove
pegomock/testutil
pegomock/util
pegomock/watch
test_interface

Package pegomock imports 12 packages (graph) and is imported by 78 packages. Updated 2019-10-16. Refresh now. Tools for package owners.