bemock

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

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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