Skip to content

Commit 98f4943

Browse files
committed
Update tests
1 parent 9a00e82 commit 98f4943

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ mod tests {
239239

240240
fn expect_304(response: Result<Response, Box<Error+Send>>) {
241241
let mut response = response.ok().expect("No response");
242-
let mut body = String::new();
243-
response.body.read_to_string(&mut body).ok().expect("No body");
242+
let mut body = Vec::new();
243+
response.body.write_body(&mut body).ok().expect("No body");
244244

245245
assert_eq!(response.status, (304, "Not Modified"));
246-
assert_eq!(body, "");
246+
assert_eq!(body, b"");
247247
}
248248

249249
fn expect_200(response: Result<Response, Box<Error+Send>>) {
@@ -252,11 +252,11 @@ mod tests {
252252

253253
fn expect(status: (u32, &'static str), response: Result<Response, Box<Error+Send>>) {
254254
let mut response = response.ok().expect("No response");
255-
let mut body = String::new();
256-
response.body.read_to_string(&mut body).ok().expect("No body");
255+
let mut body = Vec::new();
256+
response.body.write_body(&mut body).ok().expect("No body");
257257

258258
assert_eq!(response.status, status);
259-
assert_eq!(body, "hello");
259+
assert_eq!(body, b"hello");
260260
}
261261

262262
struct SimpleHandler {

0 commit comments

Comments
 (0)