| 507 | |
| 508 | #[test] |
| 509 | fn test_load_reads_gitignore() { |
| 510 | // `load` is the VCS-wide matcher (status, tracking, switch). It must |
| 511 | // honor `.gitignore`, because that is the file every project already |
| 512 | // uses to exclude build output — and without it `record` walks into |
| 513 | // those directories and fails on artifacts nobody meant to version. |
| 514 | let temp = TempDir::new().unwrap(); |
| 515 | std::fs::write(temp.path().join(".gitignore"), "node_modules/\n").unwrap(); |
| 516 | |
| 517 | let rules = IgnoreRules::load(temp.path()); |
| 518 | assert!(rules.is_ignored(Path::new("node_modules/pkg/index.js"), false)); |
| 519 | } |
| 520 | |
| 521 | #[test] |
| 522 | fn test_load_reads_dot_ignore() { |