anneal

Crates.ioanneal
lib.rsanneal
version0.3.4
sourcesrc
created_at2019-10-10 10:59:08.9286
updated_at2019-12-18 15:07:17.727764
descriptionA testing framework for Iron
homepage
repositoryhttps://git.open-communication.net/qaul/anneal
max_upload_size
id171431
size75,445
Jess (Jess3Jane)

documentation

README

Anneal

Anneal is a testing framework for Iron. It was desgined to allow testing components in isolation.

Example

use anneal::RequestBuilder;

fn main() {
    RequestBuilder::new(Method::Post, "https://127.0.0.1:8080/")
        .set_body("this is a body".into())
        .request(|mut req| {
			// test code here

            let mut s = String::new();
            req.body.read_to_string(&mut s).unwrap();
            assert_eq!(s, "this is a body");
        })
}

Features

cookies: adds a method to add a CookieJar from cookie to the request

json: adds a method to set the body to a json object via serde_json

jsonapi: adds a pair of methods for adding json-api documents to a request body

Commit count: 0

cargo fmt