pub trait StringAssertion<R> {
// Required methods
fn is_same_string_to<E: Into<String>>(&self, expected: E) -> R;
fn contains<E: Into<String>>(&self, expected: E) -> R;
fn does_not_contain<E: Into<String>>(&self, value: E) -> R;
fn starts_with<E: Into<String>>(&self, expected: E) -> R;
fn ends_with<E: Into<String>>(&self, expected: E) -> R;
}
Expand description
Trait for string assertion.
§Example
use assertor::*;
assert_that!("foobarbaz").is_same_string_to("foobarbaz");
assert_that!("foobarbaz").contains("bar");
assert_that!("foobarbaz").starts_with("foo");
assert_that!("foobarbaz").ends_with("baz");
Required Methods§
Sourcefn is_same_string_to<E: Into<String>>(&self, expected: E) -> R
fn is_same_string_to<E: Into<String>>(&self, expected: E) -> R
Checks that the subject is same string to expected
.
Sourcefn contains<E: Into<String>>(&self, expected: E) -> R
fn contains<E: Into<String>>(&self, expected: E) -> R
Checks that the subject contains expected
.
Sourcefn does_not_contain<E: Into<String>>(&self, value: E) -> R
fn does_not_contain<E: Into<String>>(&self, value: E) -> R
Checks that the subject does not contains value
.
Sourcefn starts_with<E: Into<String>>(&self, expected: E) -> R
fn starts_with<E: Into<String>>(&self, expected: E) -> R
Checks that the subject starts with expected
.
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.