项目作者: kimond

项目描述 :
A Rust fixture replacement greatly inspired by factory_bot and factory_boy.
高级语言: Rust
项目地址: git://github.com/kimond/factory_steel.git
创建时间: 2018-04-13T01:11:04Z
项目社区:https://github.com/kimond/factory_steel

开源协议:MIT License

下载


Factory_Steel

Build Status

Factory_steel is a fixture replacement greatly inspired by factory_bot
and factory_boy. Currently it is an experimental project.
Although usable, it is still very limited in term of features and reliability.

Getting started

Add this to your Cargo.toml:

  1. [dependencies]
  2. factory_steel = "0.1.0"

Example

  1. #[macro_use]
  2. extern crate factory_steel;
  3. use factory_steel::Factory;
  4. #[derive(Factory)]
  5. struct Post {
  6. #[facto(default="New post")]
  7. title: String,
  8. }
  9. fn main() {
  10. let post = Post::create();
  11. //Prints New post
  12. println!("{}", post.title);
  13. }

Contributing

Contributions are welcome! This crate is work in progress, and a lot of work remains to be done.
Have a look at the issues, and
open a pull request if you’d like to add some functionality.