Skip to content

Commit 638a14c

Browse files
committed
Small changes to docs
1 parent ffdf43d commit 638a14c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@
493493
//! request.utf8_lossy_body().unwrap().contains("hello")
494494
//! })
495495
//! .create();
496-
//!
497496
//! ```
498497
//!
499498
//! # Asserts
@@ -673,7 +672,7 @@
673672
//!
674673
//! # Non-matching calls
675674
//!
676-
//! Any calls to the Mockito server that are not matched will return *501 Mock Not Found*.
675+
//! Any calls to the Mockito server that are not matched will return *501 Not Implemented*.
677676
//!
678677
//! Note that **mocks are matched in reverse order** - the most recent one wins.
679678
//!

src/mock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl Mock {
388388
/// ```
389389
/// let mut s = mockito::Server::new();
390390
///
391-
/// let _m = s.mock("GET", mockito::Matcher::Any).with_header_from_request("user", |request| {
391+
/// let _m = s.mock("GET", mockito::Matcher::Any).with_header_from_request("x-user", |request| {
392392
/// if request.path() == "/bob" {
393393
/// "bob".into()
394394
/// } else if request.path() == "/alice" {

tests/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ fn test_mock_with_header() {
681681
fn test_mock_with_header_from_request() {
682682
let mut s = Server::new();
683683
s.mock("GET", Matcher::Any)
684-
.with_header_from_request("user", |req| {
684+
.with_header_from_request("x-user", |req| {
685685
if req.path() == "/alice" {
686686
"alice".into()
687687
} else {
@@ -691,9 +691,9 @@ fn test_mock_with_header_from_request() {
691691
.create();
692692

693693
let (_, headers, _) = request(s.host_with_port(), "GET /alice", "");
694-
assert!(headers.contains(&"user: alice".to_string()));
694+
assert!(headers.contains(&"x-user: alice".to_string()));
695695
let (_, headers, _) = request(s.host_with_port(), "GET /anyone-else", "");
696-
assert!(headers.contains(&"user: everyone".to_string()));
696+
assert!(headers.contains(&"x-user: everyone".to_string()));
697697
}
698698

699699
#[test]

0 commit comments

Comments
 (0)