Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Path

Path

Matches a request by path.

When method:

path(path)

Path.

Example:

let mock = Mock::new(|when, then| {
    when.path("/path");
    then.ok();
})

Path Prefix

Matches a request by path prefix. Returns true if the request path starts with prefix.

When method:

path_prefix(prefix)

Path prefix.

Example:

let mock = Mock::new(|when, then| {
    when.path_prefix("/p");
    then.ok();
})