pub struct SnapshotManager { /* private fields */ }Expand description
Snapshot manager for storing and comparing test snapshots
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new snapshot manager
Snapshots are stored in tests/snapshots/ by default.
Set REVUE_UPDATE_SNAPSHOTS=1 environment variable to update snapshots.
Sourcepub fn assert_snapshot(&self, name: &str, content: &str)
pub fn assert_snapshot(&self, name: &str, content: &str)
Assert snapshot matches or create if not exists
Sourcepub fn assert_buffer_snapshot(&self, name: &str, buffer: &Buffer)
pub fn assert_buffer_snapshot(&self, name: &str, buffer: &Buffer)
Assert buffer snapshot
Sourcepub fn delete_snapshot(&self, name: &str)
pub fn delete_snapshot(&self, name: &str)
Delete a snapshot file
Sourcepub fn snapshot_exists(&self, name: &str) -> bool
pub fn snapshot_exists(&self, name: &str) -> bool
Check if snapshot exists
Sourcepub fn list_snapshots(&self) -> Vec<String>
pub fn list_snapshots(&self) -> Vec<String>
List all snapshots
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more