Small library that provides a simple Hyper server wrapper for writing HTTP test servers. Vaguely inspired by Go's httptest package.
Currently only supports HTTP/1.1 and does not support TLS. Only supports the Tokio async runtime.
```rust use std::sync::{Arc, Mutex};
use minihttptest::{ handle_ok, hyper::{body, Request, Response}, Server, };
let val = Arc::new(Mutex::new(1234));
let server = {
let val = val.clone();
Server::new(move |: Request
let res = reqwest::Client::new() .get(server.url("/").to_string()) .send() .await .expect("send request");
asserteq!(res.status(), 200); asserteq!(*val.lock().expect("lock poisoned"), 1235); assert_eq!(res.text().await.expect("read response"), "1235");
asserteq!(server.reqcount(), 1); ```
Licensed under the MIT license. See LICENSE for more details.