mirror of
https://github.com/j178/prek.git
synced 2026-04-25 02:11:36 +02:00
1c034a1afb
* Use `sync_all` over `flush` * Ignore config not staged for config outside the repo * improve test
28 lines
570 B
Rust
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(())
|
|
}
|