expect_json/expects/
expect.rs1use crate::expects::ops::Contains;
2use crate::expects::ExpectOp;
3use crate::ExpectNot;
4use serde_json::Value;
5
6#[derive(Copy, Clone, Debug, PartialEq)]
7pub struct Expect {
8 pub not: ExpectNot,
9}
10
11impl Expect {
12 pub(crate) const fn new() -> Self {
13 Self { not: ExpectNot }
14 }
15
16 pub fn contains<V>(self, values: V) -> ExpectOp<Contains>
17 where
18 V: Into<Value>,
19 {
20 ExpectOp::new(Contains::new(values))
21 }
22}
23
24#[cfg(test)]
25mod test_new {
26 use super::*;
27
28 #[test]
29 fn it_should_return_correct_structure() {
30 let expect = Expect::new();
31 assert_eq!(expect, Expect { not: ExpectNot });
32 }
33}