39 releases (19 breaking)

0.20.0 Jul 29, 2019
0.18.0 Jul 11, 2019
0.17.0 Mar 25, 2019
0.14.1 Dec 21, 2018
0.1.4 Jan 11, 2016

#8 in Testing

Download history 2523/week @ 2019-04-15 2563/week @ 2019-04-22 2104/week @ 2019-04-29 1818/week @ 2019-05-06 1459/week @ 2019-05-13 1862/week @ 2019-05-20 2005/week @ 2019-05-27 2016/week @ 2019-06-03 2282/week @ 2019-06-10 1803/week @ 2019-06-17 2359/week @ 2019-06-24 2075/week @ 2019-07-01 2336/week @ 2019-07-08 2168/week @ 2019-07-15 2579/week @ 2019-07-22

8,852 downloads per month
Used in 50 crates

MIT license

67KB
1K SLoC

HTTP mocking for Rust!

Get it on crates.io.

Documentation available at https://docs.rs/mockito.

Before upgrading, make sure to check out the changelog.

Contribution Guidelines

  1. Check the existing issues and pull requests.
  2. One commit is one feature - consider squashing.
  3. :shipit:

Development

Run tests:

cargo test

Run clippy

rustup component add clippy-preview
touch src/lib.rs  # Touch the file to force cargo to rerun clippy on the project
cargo clippy --lib --tests --all-features -- -D clippy::pedantic -D clippy::nursery

Release:

cargo package && cargo publish

Run benchmarks:

rustup install nightly
rustup run nightly cargo bench

Debug output from tests

In your project, add env_logger crate, and init it before each test:

#[test]
fn example_test() {
    let _ = env_logger::try_init();
    /**/
}

and run tests with:

RUST_LOG=mockito=debug cargo test

Logo courtesy to http://niastudio.net 👌

Dependencies

~3.5MB
~84K SLoC