fluent_assertions/assertions/
bool_assertion.rs

1use super::Assertion;
2
3/// Specific assertions for booleans
4impl Assertion<bool> {
5    /// Asserts that the value is true
6    pub fn be_true(self) -> Self {
7        assert!(self.value, "Expected true, but got false");
8        self
9    }
10
11    /// Asserts that the value is false
12    pub fn be_false(self) -> Self {
13        assert!(!self.value, "Expected false, but got true");
14        self
15    }
16}
17
18#[cfg(test)]
19mod tests {
20    use crate::assertions::*;
21
22    #[test]
23    fn test_bool_assertions() {
24        let the_boolean = false;
25        the_boolean.should().be_false();
26
27        let the_boolean = true;
28        the_boolean.should().be_true();
29
30        let the_boolean = false;
31        the_boolean.should().be(false);
32    }
33}