1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Files
Jo 1c034a1afb Ignore config not staged error for config outside the repo (#270)
* Use `sync_all` over `flush`

* Ignore config not staged for config outside the repo

* improve test
2025-07-29 09:56:09 +08:00

28 lines
570 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("PREFLIGIT_HOME", &*home), @r#"
success: true
exit_code: 0
----- stdout -----
Cleaned `home`
----- stderr -----
"#);
home.assert(predicates::path::missing());
Ok(())
}