pub struct Goldie { /* private fields */ }
Implementations
sourceimpl Goldie
impl Goldie
sourcepub fn new(
source_file: impl AsRef<Path>,
function_path: impl AsRef<str>
) -> Self
pub fn new(
source_file: impl AsRef<Path>,
function_path: impl AsRef<str>
) -> Self
Construct a new golden file tester.
Where
source_file
is path to the source file that the test resides in.function_path
is the full path to the function. e.g.crate::module::tests::function_name
.
pub fn assert(&self, actual: impl AsRef<str>) -> Result<()>
pub fn assert_template(
&self,
ctx: impl Serialize,
actual: impl AsRef<str>
) -> Result<()>
pub fn assert_json(&self, actual: impl Serialize) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Goldie
impl Send for Goldie
impl Sync for Goldie
impl Unpin for Goldie
impl UnwindSafe for Goldie
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more