Trait AssertStringMatches

Source
pub trait AssertStringMatches {
    // Required method
    fn matches(self, regex_pattern: &str) -> Self;
}
Available on crate feature regex only.
Expand description

Assert that a string matches a regex pattern.

§Example

use asserting::prelude::*;

assert_that("tation odio placerat in").matches(r"\b\w{8}\b");

Required Methods§

Source

fn matches(self, regex_pattern: &str) -> Self

Verifies that a string matches the given regex pattern.

§Example
use asserting::prelude::*;

assert_that("tation odio placerat in").matches(r"\b\w{8}\b");

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<S, R> AssertStringMatches for Spec<'_, S, R>
where S: AsRef<str> + Debug, R: FailingStrategy,