Factori
A testing factory library for Rust, inspired by FactoryBot. 🤖 🦀
Factori works on stable Rust >=1.26. It aims to provide a clean, ergonomic syntax for instantiating test objects, without sacrificing type-safety.
Example
Factori provides two macros: factori!
, which defines a factory for a type, and create!
which instantiates it:
// Factori's macros recurse a lot. You may need to tell the compiler to increase its macro
// recursion limit. It should not affect run-time performance.
extern crate factori;
factori!;
More examples are available in the tests/
directory.
Stability
Factori is still brand new, and the syntax may change significantly between point-releases.
Testing
Run:
License
MIT