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.
- Check the existing issues and pull requests.
- One commit is one feature - consider squashing.
- Format code with
cargo fmt
.
Run tests:
cargo test
...or run tests using a different toolchain:
rustup run --install 1.36.0 cargo test
...or run tests while disabling the default features (e.g. the colors):
cargo test --no-default-features
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.
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.36.0 cargo clippy --lib --tests --all-features -- -D clippy::pedantic -D clippy::nursery
Release:
cargo publish
Install rust nightly
:
rustup install nightly
Run benchmarks:
rustup run nightly cargo bench
Logo courtesy to http://niastudio.net 👌