import "github.com/petergtz/pegomock"
dsl.go invocation_count_matchers.go matcher.go matcher_factories.go testing_t_support.go types.go
func AnyComplex128() complex128
func AnyComplex128Slice() []complex128
func AnyInterface() interface{}
func AnyInterfaceSlice() []interface{}
func BoolSliceThat(matcher ArgumentMatcher) []bool
func BoolThat(matcher ArgumentMatcher) bool
func Complex128SliceThat(matcher ArgumentMatcher) []complex128
func Complex128That(matcher ArgumentMatcher) complex128
func Complex64SliceThat(matcher ArgumentMatcher) []complex64
func Complex64That(matcher ArgumentMatcher) complex64
func EqComplex128(value complex128) complex128
func EqComplex128Slice(value []complex128) []complex128
func EqInterface(value interface{}) interface{}
func EqInterfaceSlice(value []interface{}) []interface{}
func Float32SliceThat(matcher ArgumentMatcher) []float32
func Float32That(matcher ArgumentMatcher) float32
func Float64SliceThat(matcher ArgumentMatcher) []float64
func Float64That(matcher ArgumentMatcher) float64
func Int16SliceThat(matcher ArgumentMatcher) []int16
func Int16That(matcher ArgumentMatcher) int16
func Int32SliceThat(matcher ArgumentMatcher) []int32
func Int32That(matcher ArgumentMatcher) int32
func Int64SliceThat(matcher ArgumentMatcher) []int64
func Int64That(matcher ArgumentMatcher) int64
func Int8SliceThat(matcher ArgumentMatcher) []int8
func Int8That(matcher ArgumentMatcher) int8
func IntSliceThat(matcher ArgumentMatcher) []int
func IntThat(matcher ArgumentMatcher) int
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 InterfaceSliceThat(matcher ArgumentMatcher) []interface{}
func InterfaceThat(matcher ArgumentMatcher) interface{}
func NotEqComplex128(value complex128) complex128
func NotEqComplex128Slice(value []complex128) []complex128
func NotEqInterface(value interface{}) interface{}
func NotEqInterfaceSlice(value []interface{}) []interface{}
func RegisterMatcher(matcher ArgumentMatcher)
func RegisterMockFailHandler(handler FailHandler)
func StringSliceThat(matcher ArgumentMatcher) []string
func StringThat(matcher ArgumentMatcher) string
func Uint16SliceThat(matcher ArgumentMatcher) []uint16
func Uint16That(matcher ArgumentMatcher) uint16
func Uint32SliceThat(matcher ArgumentMatcher) []uint32
func Uint32That(matcher ArgumentMatcher) uint32
func Uint64SliceThat(matcher ArgumentMatcher) []uint64
func Uint64That(matcher ArgumentMatcher) uint64
func Uint8SliceThat(matcher ArgumentMatcher) []uint8
func Uint8That(matcher ArgumentMatcher) uint8
func UintSliceThat(matcher ArgumentMatcher) []uint
func UintThat(matcher ArgumentMatcher) uint
func UintptrSliceThat(matcher ArgumentMatcher) []uintptr
func UintptrThat(matcher ArgumentMatcher) uintptr
func When(invocation ...interface{}) *ongoingStubbing
func NewAnyMatcher(typ reflect.Type) *AnyMatcher
func (matcher *AnyMatcher) FailureMessage() string
func (matcher *AnyMatcher) Matches(param Param) bool
func (matcher *AnyMatcher) String() string
ArgumentMatcher can be used to match arguments.
func AtLeast(numDesiredInvocations int) *AtLeastIntMatcher
func (matcher *AtLeastIntMatcher) FailureMessage() string
func (matcher *AtLeastIntMatcher) Matches(param Param) bool
func (matcher *AtLeastIntMatcher) String() string
func AtMost(numDesiredInvocations int) *AtMostIntMatcher
func (matcher *AtMostIntMatcher) FailureMessage() string
func (matcher *AtMostIntMatcher) Matches(param Param) bool
func (matcher *AtMostIntMatcher) String() string
var GlobalFailHandler FailHandler
func BuildTestingTFailHandler(t testingT) FailHandler
func GetGenericMockFrom(mock Mock) *GenericMock
func (genericMock *GenericMock) GetInvocationParams(methodInvocations []MethodInvocation) [][]Param
TODO this doesn't need to be a method, can be a free function
func (genericMock *GenericMock) Invoke(methodName string, params []Param, returnTypes []reflect.Type) ReturnValues
func (genericMock *GenericMock) Verify( inOrderContext *InOrderContext, invocationCountMatcher InvocationCountMatcher, methodName string, params []Param, options ...interface{}, ) []MethodInvocation
type InOrderContext struct {
// contains filtered or unexported fields
}
InvocationCountMatcher can be used to match invocation counts. It is guaranteed that FailureMessage will always be called after Matches so an implementation can save state.
Matcher can be used to match arguments as well as invocation counts. Note that support for overlapping embedded interfaces was added in Go 1.14, which is why ArgumentMatcher and InvocationCountMatcher are not embedded here.
type Matchers []ArgumentMatcher
type MethodInvocation struct {
// contains filtered or unexported fields
}
type Mock interface { SetFailHandler(FailHandler) FailHandler() FailHandler }
func (matcher *NotEqMatcher) FailureMessage() string
func (matcher *NotEqMatcher) Matches(param Param) bool
func (matcher *NotEqMatcher) String() string
func WithFailHandler(fail FailHandler) Option
func (f OptionFunc) Apply(mock Mock)
type Param interface{}
type ReturnValue interface{}
type ReturnValues []ReturnValue
type Stubbing struct {
// contains filtered or unexported fields
}
func (stubbing *Stubbing) Invoke(params []Param) ReturnValues
Path | Synopsis |
---|---|
ginkgo_compatible | |
internal/generate_matchers | |
internal/verify | |
matchers | Code generated by pegomock. |
mockgen | MockGen generates mock implementations of Go interfaces. |
mockgen/util | |
model | Package model contains the data model necessary for generating mock implementations. |
modelgen/gomock | |
modelgen/loader | |
modelgen/test_data/default_test_interface | |
pegomock | |
pegomock/filehandling | |
pegomock/remove | |
pegomock/testutil | |
pegomock/util | |
pegomock/watch | |
test_interface |
Package pegomock imports 12 packages (graph) and is imported by 153 packages. Updated 2020-12-15. Refresh now. Tools for package owners.