Skip to main content

Crate fnmock_derive

Crate fnmock_derive 

Source
Expand description

Proc-macro implementation behind fnmock.

Everything here except the mockable attribute and its two single-half variants, fakeable and spyable, is a fnmock internal. Depend on the fnmock crate rather than on this one. It re-exports the attributes as fnmock::mockable, fnmock::fakeable and fnmock::spyable.

See the README for installation, a walkthrough and the current limitations.

Attribute Macros§

fakeable
Replace a free function’s or impl method’s body in tests, without recording calls.
mockable
Mock a free function or the methods of an inherent impl block in tests.
spyable
Record a free function’s or impl method’s calls in tests and assert on them. The real body always runs.