Skip to content

Commit

Permalink
Small changes to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lipanski committed Nov 13, 2024
1 parent ffdf43d commit 638a14c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@
//! request.utf8_lossy_body().unwrap().contains("hello")
//! })
//! .create();
//!
//! ```
//!
//! # Asserts
Expand Down Expand Up @@ -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.
//!
Expand Down
2 changes: 1 addition & 1 deletion src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
6 changes: 3 additions & 3 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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]
Expand Down

0 comments on commit 638a14c

Please sign in to comment.