Trait assertor::StringAssertion
source · 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
.