[-] Remove legacy features

This commit is contained in:
2026-05-09 17:41:20 +00:00
parent f3c0b90a0d
commit 10c55062eb
14 changed files with 107 additions and 200 deletions
+18 -15
View File
@@ -21,21 +21,14 @@ fn cli_rejects_removed_config_subcommands() {
}
#[test]
fn cli_accepts_sync_repo_pattern() {
let cli = Cli::try_parse_from([
"refray",
"sync",
"--repo-pattern",
"^(foo|bar)-",
"--dry-run",
])
.unwrap();
let Command::Sync(args) = cli.command else {
panic!("parsed unexpected command");
};
assert_eq!(args.repo_pattern, Some("^(foo|bar)-".to_string()));
assert!(args.dry_run);
fn cli_rejects_removed_sync_args() {
for args in [
["refray", "sync", "--repo-pattern", "^(foo|bar)-"].as_slice(),
["refray", "sync", "--work-dir", "/tmp/refray"].as_slice(),
["refray", "sync", "--force"].as_slice(),
] {
assert!(Cli::try_parse_from(args).is_err());
}
}
#[test]
@@ -85,6 +78,7 @@ fn cli_rejects_removed_serve_args() {
["refray", "serve", "--secret", "secret"].as_slice(),
["refray", "serve", "--secret-env", "WEBHOOK_SECRET"].as_slice(),
["refray", "serve", "--full-sync-interval-minutes", "30"].as_slice(),
["refray", "serve", "--work-dir", "/tmp/refray"].as_slice(),
] {
assert!(Cli::try_parse_from(args).is_err());
}
@@ -262,6 +256,15 @@ fn cli_rejects_removed_webhook_update_secret_args() {
"WEBHOOK_SECRET",
]
.as_slice(),
[
"refray",
"webhook",
"update",
"https://new.example.test/webhook",
"--work-dir",
"/tmp/refray",
]
.as_slice(),
] {
assert!(Cli::try_parse_from(args).is_err());
}