Documentation
¶
Overview ¶
Package birb provides a simple interface for creating and verifying mock interactions.
Index ¶
- func Anything() matchers.Matcher
- func AtLeast(n int) *handlers.CallVerifier
- func AtMost(n int) *handlers.CallVerifier
- func Captor() matchers.Captor
- func CopyIntoFunc[T any](toCopy T, copyFunc matchers.CopyIntoFunc[T]) matchers.CopyInto
- func DeepCopyInto[T matchers.DeepCopyInto[T]](toCopy T) matchers.CopyInto
- func Freeze[Mock Birb](mock Mock)
- func Never() *handlers.CallVerifier
- func Once() *handlers.CallVerifier
- func ShallowCopyInto[T any](toCopy *T) matchers.CopyInto
- func Times(n int) *handlers.CallVerifier
- func Twice() *handlers.CallVerifier
- func Verify[Mock Birb](mock Mock, v *handlers.CallVerifier) Mock
- func VerifyNeverCalled[Mock Birb](mock Mock)
- func VerifyNoOtherInteractions[Mock Birb](mock Mock)
- func WhenCalling(ans *handlers.BirbMocker) *handlers.BirbMocker
- func WithAnyArgs() matchers.Matcher
- type Birb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Anything ¶
Anything is a matcher that matches any SINGULAR value. This is useful when you don't care about the specific value passed to a method.
func AtLeast ¶
func AtLeast(n int) *handlers.CallVerifier
AtLeast is a helper function to create verifiers that expect the method to be called at least n times.
func AtMost ¶
func AtMost(n int) *handlers.CallVerifier
AtMost is a helper function to create verifiers that expect the method to be called at most n times.
func Captor ¶
Captor is a matcher that captures the value passed to a method. This is useful when you want to verify the value passed to a method after it has been called.
func CopyIntoFunc ¶
func CopyIntoFunc[T any](toCopy T, copyFunc matchers.CopyIntoFunc[T]) matchers.CopyInto
CopyIntoFunc
func DeepCopyInto ¶
func DeepCopyInto[T matchers.DeepCopyInto[T]](toCopy T) matchers.CopyInto
DeepCopyInto
func Freeze ¶
func Freeze[Mock Birb](mock Mock)
Freeze verifies that no methods will be called on the Birb instance.
func Never ¶
func Never() *handlers.CallVerifier
Never helper function to create a verifier that expects the method to have never been called.
func Once ¶
func Once() *handlers.CallVerifier
Once helper function to create a verifier that expects the method to be called exactly once.
func ShallowCopyInto ¶
ShallowCopyInto is a convenience function to create a CopyInto matcher that copies the value from a pointer.
func Times ¶
func Times(n int) *handlers.CallVerifier
Times verify that a method is called exactly n times.
func Twice ¶
func Twice() *handlers.CallVerifier
Twice helper function to create a verifier that expects the method to be called exactly twice.
func Verify ¶
func Verify[Mock Birb](mock Mock, v *handlers.CallVerifier) Mock
Verify will verify that the Birb instance has been called as expected.
func VerifyNeverCalled ¶
func VerifyNeverCalled[Mock Birb](mock Mock)
VerifyNeverCalled verifies that no methods were called on the Birb instance that were not already verified.
func VerifyNoOtherInteractions ¶
func VerifyNoOtherInteractions[Mock Birb](mock Mock)
VerifyNoOtherInteractions verifies that no methods were called on the Birb instance that were not already verified.
func WhenCalling ¶
func WhenCalling(ans *handlers.BirbMocker) *handlers.BirbMocker
WhenCalling is the API to use for setting up method stubs on a Birb mock.
func WithAnyArgs ¶
WithAnyArgs is a matcher that matches any values. This is useful when you don't care about the specific value passed to a method.