Function xpct::be_none

source ·
pub fn be_none<'a, T>() -> Matcher<'a, Option<T>, Option<Infallible>, T>where
    T: Debug + 'a,
Expand description

Succeeds when the actual value is None.

If this matcher succeeds, it converts the value to Option<Infallible>. When negated, it behaves like be_some.

Examples

use std::convert::Infallible;
use xpct::{expect, be_none, equal};

let value: Option<String> = None;

let output: Option<Infallible> = expect!(value)
    .to(be_none())
    .into_inner();