Skip to main content

Module testing

Module testing 

Source
Expand description

Helpers for testing apps that use crux_http.

The two entry points mirror the two things a feature can receive:

  • ResponseBuilder builds the Ok(Response) of a successful exchange.
  • rejection builds the Err(HttpError::Http { .. }) of a 4xx/5xx rejection, body included — or rejection_from, when the rejection’s headers matter too.

There is no third case: a Response never carries an error status, so ResponseBuilder refuses to build one.

Structs§

ResponseBuilder
Allows users to build an http response.

Functions§

rejection
Build the crux_http::Result a feature receives when the server rejects a request.
rejection_from
Build the crux_http::Result a feature receives for a rejection, from a full protocol response.