Skip to main content

AssertDebugString

Trait AssertDebugString 

Source
pub trait AssertDebugString<'a, R> {
    // Required method
    fn debug_string(self) -> Spec<'a, String, R>;
}
Expand description

Mapping the subject into its debug string representation to do assertions on its debug string.

§Examples

use asserting::prelude::*;

#[derive(Debug)]
struct Foo {
    hello: String,
}

let subject = Foo { hello: "World".into() };

assert_that!(&subject).debug_string().contains("World");
assert_that!(&subject).debug_string().does_not_start_with("Bar");

Required Methods§

Source

fn debug_string(self) -> Spec<'a, String, R>

Maps the subject into its debug string representation to do assertions on its debug string.

§Examples
use asserting::prelude::*;

#[derive(Debug)]
struct Foo {
    hello: String,
}

let subject = Foo { hello: "World".into() };

assert_that!(&subject).debug_string().contains("World");
assert_that!(&subject).debug_string().does_not_start_with("Bar");

Implementors§

Source§

impl<'a, S, R> AssertDebugString<'a, R> for Spec<'a, S, R>
where S: Debug, R: FailingStrategy,