37 releases (17 breaking)

0.18.0 Jul 11, 2019
0.17.0 Mar 25, 2019
0.14.1 Dec 21, 2018
0.14.0 Nov 18, 2018
0.1.4 Jan 11, 2016

#5 in Testing

Download history 1357/week @ 2019-03-28 1827/week @ 2019-04-04 2186/week @ 2019-04-11 2695/week @ 2019-04-18 2308/week @ 2019-04-25 2000/week @ 2019-05-02 1528/week @ 2019-05-09 1674/week @ 2019-05-16 1836/week @ 2019-05-23 2131/week @ 2019-05-30 2244/week @ 2019-06-06 1860/week @ 2019-06-13 2103/week @ 2019-06-20 2566/week @ 2019-06-27 1819/week @ 2019-07-04

8,840 downloads per month
Used in 40 crates

MIT license

62KB
998 lines

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

~4.5MB
~75K SLoC