sync from monorepo @ 2452e92e
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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(_)));
|
||||
}
|
||||
Reference in New Issue
Block a user