https://github.com/http-rs/tide-testing
ergonomic tide testing extension
https://github.com/http-rs/tide-testing
Last synced: 7 months ago
JSON representation
ergonomic tide testing extension
- Host: GitHub
- URL: https://github.com/http-rs/tide-testing
- Owner: http-rs
- Created: 2020-10-18T03:07:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-25T09:19:31.000Z (almost 4 years ago)
- Last Synced: 2025-09-23T15:31:48.677Z (9 months ago)
- Language: Rust
- Size: 22.5 KB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# tide-testing
## a convenient bridge between surf and tide to generate synthetic requests for testing
* [CI ![CI][ci-badge]][ci]
* [API Docs][docs] [![docs.rs docs][docs-badge]][docs]
* [Releases][releases] [![crates.io version][version-badge]][lib-rs]
* [Contributing][contributing]
[ci]: https://github.com/jbr/tide-testing/actions?query=workflow%3ACI
[ci-badge]: https://github.com/jbr/tide-testing/workflows/CI/badge.svg
[releases]: https://github.com/jbr/tide-testing/releases
[docs]: https://docs.rs/tide-testing
[contributing]: https://github.com/jbr/tide-testing/blob/main/.github/CONTRIBUTING.md
[lib-rs]: https://lib.rs/tide-testing
[docs-badge]: https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square
[version-badge]: https://img.shields.io/crates/v/tide-testing.svg?style=flat-square
## Installation
```
$ cargo add -D tide-testing
```
## Example usage:
```rust
let mut app = tide::new();
app.at("/").get(|_| async { Ok("hello!") });
use tide_testing::TideTestingExt;
assert_eq!(app.get("/").recv_string().await?, "hello!");
assert_eq!(
app.post("/missing").await?.status(),
tide::http::StatusCode::NotFound
);
```
## Cargo Features:
## Safety
This crate uses ``#![deny(unsafe_code)]`` to ensure everything is implemented in
100% Safe Rust.
## License
Licensed under either of Apache License, Version
2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.