bemock

package module
v1.0.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bemock adapts expectto/be matchers for use as testify/mockery mock argument matchers.

It lives in its own module (github.com/expectto/be/x/mock) so the core `be` module never depends on testify. Assertions don't live here — use the core be.AssertThat / be.RequireThat (or be.Expect/Require) instead. Gomock needs no adapter either (every be matcher already satisfies gomock.Matcher); this module's sole job is the testify/mockery adapter below.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchedBy

func MatchedBy(matcher types.BeMatcher) any

MatchedBy adapts a be matcher into a testify/mock argument matcher, the matcher equivalent of testify's own mock.MatchedBy(func). It works with hand-written testify mocks and mockery-generated mocks alike:

svc.On("Do", bemock.MatchedBy(be_math.GreaterThan(10))).Return("ok")

Types

This section is empty.

Jump to

Keyboard shortcuts

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