crux_http/testing/mod.rs
1//! Helpers for testing apps that use `crux_http`.
2//!
3//! The two entry points mirror the two things a feature can receive:
4//!
5//! - [`ResponseBuilder`] builds the `Ok(Response)` of a successful exchange.
6//! - [`rejection`] builds the `Err(HttpError::Http { .. })` of a 4xx/5xx rejection, body
7//! included — or [`rejection_from`], when the rejection's headers matter too.
8//!
9//! There is no third case: a `Response` never carries an error status, so
10//! `ResponseBuilder` refuses to build one.
11
12mod rejection;
13mod response_builder;
14
15#[cfg(test)]
16mod fake_shell;
17
18pub use rejection::{rejection, rejection_from};
19pub use response_builder::ResponseBuilder;
20
21#[cfg(test)]
22pub(crate) use fake_shell::FakeShell;