use dirigent_tools::policy::{Decision, Op, Policy};
use std::fs;
use tempfile::TempDir;

#[test]
fn dirigent_tools_can_use_fermata_policy() {
    let tmp = TempDir::new().unwrap();
    fs::write(tmp.path().join(".botignore"), ".env\n").unwrap();
    let target = tmp.path().join(".env");
    fs::write(&target, "").unwrap();
    let policy = Policy::load(tmp.path()).unwrap();
    let d = policy.check(Op::Read, &target).unwrap();
    assert!(matches!(d, Decision::Deny(_)));
}
