diff --git a/src/lib.rs b/src/lib.rs index 6057d81..49ad7a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -493,7 +493,6 @@ //! request.utf8_lossy_body().unwrap().contains("hello") //! }) //! .create(); -//! //! ``` //! //! # Asserts @@ -673,7 +672,7 @@ //! //! # Non-matching calls //! -//! Any calls to the Mockito server that are not matched will return *501 Mock Not Found*. +//! Any calls to the Mockito server that are not matched will return *501 Not Implemented*. //! //! Note that **mocks are matched in reverse order** - the most recent one wins. //! diff --git a/src/mock.rs b/src/mock.rs index fafab9c..95ea323 100644 --- a/src/mock.rs +++ b/src/mock.rs @@ -388,7 +388,7 @@ impl Mock { /// ``` /// let mut s = mockito::Server::new(); /// - /// let _m = s.mock("GET", mockito::Matcher::Any).with_header_from_request("user", |request| { + /// let _m = s.mock("GET", mockito::Matcher::Any).with_header_from_request("x-user", |request| { /// if request.path() == "/bob" { /// "bob".into() /// } else if request.path() == "/alice" { diff --git a/tests/lib.rs b/tests/lib.rs index 4ce3b78..66601a0 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -681,7 +681,7 @@ fn test_mock_with_header() { fn test_mock_with_header_from_request() { let mut s = Server::new(); s.mock("GET", Matcher::Any) - .with_header_from_request("user", |req| { + .with_header_from_request("x-user", |req| { if req.path() == "/alice" { "alice".into() } else { @@ -691,9 +691,9 @@ fn test_mock_with_header_from_request() { .create(); let (_, headers, _) = request(s.host_with_port(), "GET /alice", ""); - assert!(headers.contains(&"user: alice".to_string())); + assert!(headers.contains(&"x-user: alice".to_string())); let (_, headers, _) = request(s.host_with_port(), "GET /anyone-else", ""); - assert!(headers.contains(&"user: everyone".to_string())); + assert!(headers.contains(&"x-user: everyone".to_string())); } #[test]