@@ -117,7 +117,7 @@ mod tests {
117
117
impl conduit:: Request for RequestSentinel {
118
118
fn http_version ( & self ) -> semver:: Version { unimplemented ! ( ) }
119
119
fn conduit_version ( & self ) -> semver:: Version { unimplemented ! ( ) }
120
- fn method ( & self ) -> Method { self . method }
120
+ fn method ( & self ) -> Method { self . method . clone ( ) }
121
121
fn scheme ( & self ) -> Scheme { unimplemented ! ( ) }
122
122
fn host < ' a > ( & ' a self ) -> Host < ' a > { unimplemented ! ( ) }
123
123
fn virtual_root < ' a > ( & ' a self ) -> Option < & ' a str > { unimplemented ! ( ) }
@@ -244,9 +244,9 @@ mod tests {
244
244
let mut req = RequestSentinel :: new ( Method :: Get , "/" ) ;
245
245
let mut res = builder. call ( & mut req) . ok ( ) . expect ( "No response" ) ;
246
246
247
- let mut s = String :: new ( ) ;
248
- res. body . read_to_string ( & mut s) . unwrap ( ) ;
249
- assert_eq ! ( s, "hello" . to_string ( ) ) ;
247
+ let mut s = Vec :: new ( ) ;
248
+ res. body . write_body ( & mut s) . unwrap ( ) ;
249
+ assert_eq ! ( s, b "hello") ;
250
250
}
251
251
252
252
#[ test]
@@ -272,9 +272,9 @@ mod tests {
272
272
let mut res = builder. call ( & mut req) . ok ( ) . expect ( "Error not handled" ) ;
273
273
274
274
assert_eq ! ( res. status, ( 500 , "Internal Server Error" ) ) ;
275
- let mut s = String :: new ( ) ;
276
- res. body . read_to_string ( & mut s) . unwrap ( ) ;
277
- assert_eq ! ( s, "Error in handler" . to_string ( ) ) ;
275
+ let mut s = Vec :: new ( ) ;
276
+ res. body . write_body ( & mut s) . unwrap ( ) ;
277
+ assert_eq ! ( s, b "Error in handler") ;
278
278
}
279
279
280
280
#[ test]
@@ -286,8 +286,8 @@ mod tests {
286
286
let mut req = RequestSentinel :: new ( Method :: Get , "/" ) ;
287
287
let mut res = builder. call ( & mut req) . ok ( ) . expect ( "No response" ) ;
288
288
289
- let mut s = String :: new ( ) ;
290
- res. body . read_to_string ( & mut s) . unwrap ( ) ;
291
- assert_eq ! ( s, "hello hello" . to_string ( ) ) ;
289
+ let mut s = Vec :: new ( ) ;
290
+ res. body . write_body ( & mut s) . unwrap ( ) ;
291
+ assert_eq ! ( s, b "hello hello") ;
292
292
}
293
293
}
0 commit comments