1
0
mirror of https://github.com/j178/prek.git synced 2026-05-05 18:25:21 +02:00
Files
prek/tests/clean.rs
T

28 lines
565 B
Rust

use assert_fs::assert::PathAssert;
use assert_fs::fixture::{PathChild, PathCreateDir};
use crate::common::{TestContext, cmd_snapshot};
mod common;
#[test]
fn clean() -> anyhow::Result<()> {
let context = TestContext::new();
let home = context.work_dir().child("home");
home.create_dir_all()?;
cmd_snapshot!(context.filters(), context.clean().env("PREK_HOME", &*home), @r#"
success: true
exit_code: 0
----- stdout -----
Cleaned `home`
----- stderr -----
"#);
home.assert(predicates::path::missing());
Ok(())
}