You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 fortype `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]fntest_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
The text was updated successfully, but these errors were encountered:
Description
Executing
cargo test
with the provided example does not work.Changing the test to read:
Fixes the issue as
iron_test::response::extract_body_to_bytes
takes an argument of typeiron::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
The text was updated successfully, but these errors were encountered: