shoulda/
lib.rs

1use crate::core::Should;
2pub use shoulda_core as core;
3pub use shoulda_core::Shoulda;
4pub use shoulda_macro::expr as expr_internal;
5pub use shoulda_macro::Shoulda;
6
7#[macro_export]
8macro_rules! expr {
9    ($x:expr) => {
10        ::shoulda::expr_internal!($x)
11    };
12}
13
14#[macro_export]
15macro_rules! expect {
16    ($x:tt) => {
17        ::shoulda::Expect::new(&$x)
18    };
19}
20
21pub struct Expect<'a, T: Shoulda> {
22    inner: &'a T,
23}
24
25impl<'a, T: Shoulda> Expect<'a, T> {
26    pub fn new(inner: &'a T) -> Self {
27        Self { inner }
28    }
29    pub fn to(self) -> Should<'a, T> {
30        self.inner.should()
31    }
32}