stubr 0.6.2

Wiremock implemented in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::wiremock::matchers::{path_regex, PathRegexMatcher};
use crate::{StubrError, StubrResult};

use super::HttpUrlStub;

impl TryFrom<&HttpUrlStub> for PathRegexMatcher {
    type Error = StubrError;

    fn try_from(http_url: &HttpUrlStub) -> StubrResult<Self> {
        http_url
            .url_path_pattern
            .as_deref()
            .map(path_regex)
            .ok_or_else(|| StubrError::QuietError)
    }
}