41 releases (21 breaking)

✓ Uses Rust 2018 edition

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

#7 in Testing

Download history 2116/week @ 2019-07-29 2059/week @ 2019-08-05 2321/week @ 2019-08-12 2359/week @ 2019-08-19 2851/week @ 2019-08-26 2302/week @ 2019-09-02 2145/week @ 2019-09-09 2865/week @ 2019-09-16 2791/week @ 2019-09-23 2481/week @ 2019-09-30 2799/week @ 2019-10-07 2363/week @ 2019-10-14 2538/week @ 2019-10-21 3165/week @ 2019-10-28 3885/week @ 2019-11-04

11,449 downloads per month
Used in 61 crates (60 directly)

MIT license

70KB
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

~3MB
~68K SLoC