noir::hyper_client! [] [src]

macro_rules! hyper_client {
    () => { ... };
}

A macro for intercepting hyper::Client::new() calls made during tests.

During testing (#[cfg(test)]) the macro will be replaced with hyper::Client::with_connector(...)

Outside of testing the macro will be compiled out and reduce itself to a normal hyper::Client::new() call.

Example Usage


let client = hyper_client!();
let request = client.get(
    "https://example.com/"
);