From c44e4ad1001b0be0b7148990b468680a22b7f5fc Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 19 Nov 2017 18:02:31 -1000 Subject: [PATCH] expect error tests --- src/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/error.rs b/src/error.rs index a91edfd7e..d2808533b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -393,6 +393,14 @@ mod tests { assert_eq!(e, HttpRangeError::NoOverlap); } + #[test] + fn test_expect_error() { + let resp: HttpResponse = ExpectError::Encoding.error_response(); + assert_eq!(resp.status(), StatusCode::EXPECTATION_FAILED); + let resp: HttpResponse = ExpectError::UnknownExpect.error_response(); + assert_eq!(resp.status(), StatusCode::EXPECTATION_FAILED); + } + #[test] fn test_wserror_http_response() { let resp: HttpResponse = WsHandshakeError::GetMethodRequired.error_response();