# asomers/mockall

A powerful mock object library for Rust

Repository: https://github.com/asomers/mockall
Canonical: https://ross.abutalabs.com/products/mockall
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2026-06-28T21:00:19+00:00

## Health v2 (maintenance only)
Score: 72/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 89, release rhythm 35, longevity 100
- inputs: {"age_days": 2764, "days_push": 66, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1832, forks 81 (observed 2026-08-28T04:05:42.327011+00:00)

## What it is
Mockall is a mock object library for Rust that generates mock implementations of traits and structs via procedural macros for use in unit tests. It provides expectation setting, argument matching, and return value control with a terse, ergonomic API in 100% safe, stable Rust.

## Use cases
- mock traits in Rust unit tests
- inject error cases into tests
- test upper layers without lower dependencies
- generate mock structs automatically
- verify method call counts and arguments

## When to choose
- you need powerful mocking in Rust unit tests
- you want automatic mock generation from traits
- you need argument matchers and call expectations

## When to avoid
- you only need simple stubs or fakes
- you are testing integration or end-to-end rather than unit tests

## Facets
- artifact type: library
- maturity: stable
- function: mocking, testing
- domain: testing, developer-tools
- platform: rust, cross-platform
- tags: unit-testing, proc-macros, test-doubles, rust

## Member repositories
- asomers/mockall (main) score 72

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:42.327011+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:19:08.974110+00:00, confidence not recorded.
  - readme: https://github.com/asomers/mockall (fetched 2026-08-28T04:05:42.327011+00:00, sha cf9cac5c98bf)
  - registry_crates: https://crates.io/api/v1/crates/mockall (fetched 2026-08-29T10:57:55.558782+00:00, sha 8cb617f31447)
- Data as of 2026-08-30T08:39:29.467469+00:00.
