-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Description
Executing cargo test with the provided example does not work.
$ cargo test ✱
Compiling hello-world v0.0.1 (file:///Users/willweiss/dev/rust/hello-world)
src/main.rs:21:64: 21:70 error: no method named `unwrap` found for type `iron::Response` in the current scope
src/main.rs:21 let result_body = response::extract_body_to_bytes(response.unwrap());
^~~~~~
error: aborting due to previous error
error: Could not compile `hello-world`.Changing the test to read:
#[test]
fn test_hello_world() {
let res = request::get("http://localhost:3000/hello",
Headers::new(),
&HelloWorldHandler).unwrap();
let result_body = response::extract_body_to_bytes(res);
assert_eq!(result_body, b"Hello, world!");
}Fixes the issue as iron_test::response::extract_body_to_bytes takes an argument of type iron::response::Response per the docs.
Thanks in advance!
Environment
darwin 14.5.0
cargo 0.10.0-nightly (10ddd7d 2016-04-08)
iron 0.3.0
iron-test 0.3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels