54 releases (28 breaking)

0.30.0 Mar 18, 2021
0.28.0 Nov 4, 2020
0.27.0 Jul 25, 2020
0.23.3 Feb 21, 2020
0.1.4 Jan 11, 2016

#12 in Testing

Download history 7026/week @ 2021-01-13 8193/week @ 2021-01-20 8022/week @ 2021-01-27 7711/week @ 2021-02-03 8345/week @ 2021-02-10 8731/week @ 2021-02-17 9328/week @ 2021-02-24 8369/week @ 2021-03-03 9707/week @ 2021-03-10 9574/week @ 2021-03-17 10074/week @ 2021-03-24 8719/week @ 2021-03-31 9162/week @ 2021-04-07 9974/week @ 2021-04-14 9046/week @ 2021-04-21 7302/week @ 2021-04-28

32,046 downloads per month
Used in 158 crates (157 directly)

MIT license

76KB
1K SLoC

HTTP mocking for Rust!

Get it on crates.io.

Documentation is 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. Format code with cargo fmt.
  4. :shipit:

Development

Tests

Run tests:

cargo test

...or run tests using a different toolchain:

rustup run --install 1.42.0 cargo test

...or run tests while disabling the default features (e.g. the colors):

cargo test --no-default-features

Code style

Mockito uses rustfmt as a general code style.

Install rustfmt:

rustup component add rustfmt

Format code:

cargo fmt

Some editors might provide a plugin to format your Rust code automatically.

Linter

Mockito uses clippy and it should be run always on the minimum supported Rust version, in order to ensure backwards compatibility.

Install clippy:

rustup component add clippy-preview

Run the linter on the minimum supported Rust version:

rustup run --install 1.42.0 cargo clippy --lib --tests --all-features -- -D clippy::complexity

Release

Release:

cargo publish

Benchmarks

Install rust nightly:

rustup install nightly

Run benchmarks:

rustup run nightly cargo bench

Logo courtesy to http://niastudio.net 👌

Dependencies

~2.1–2.9MB
~67K SLoC