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§

source

fn is_same_string_to<E: Into<String>>(&self, expected: E) -> R

Checks that the subject is same string to expected.

source

fn contains<E: Into<String>>(&self, expected: E) -> R

Checks that the subject contains expected.

source

fn does_not_contain<E: Into<String>>(&self, value: E) -> R

Checks that the subject does not contains value.

source

fn starts_with<E: Into<String>>(&self, expected: E) -> R

Checks that the subject starts with expected.

source

fn ends_with<E: Into<String>>(&self, expected: E) -> R

Checks that the subject ends with expected.

Implementors§