Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip allowed prefixes #416

Merged
merged 11 commits into from
Dec 19, 2024
Prev Previous commit
Next Next commit
test(cmd): Verify fixup check
  • Loading branch information
epage committed Dec 19, 2024
commit 9f27124ce30b36fdfe825dc51338b1486acfa030
33 changes: 33 additions & 0 deletions crates/committed/tests/cmd.rs
Original file line number Diff line number Diff line change
@@ -44,6 +44,39 @@ fn wip_stops_checks() {
.stderr_eq(str![]);
}

#[test]
fn fixup_fails() {
run_committed("fixup! bad times ahead", "")
.code(1)
.stdout_eq(str![[r#"
-: error Fixup commits must be squashed

"#]])
.stderr_eq(str![]);
}

#[test]
fn fixup_config_override() {
run_committed("fixup! bad times ahead", "no_fixup = false")
.code(1)
.stdout_eq(str![[r#"
-: error Subject should be capitalized but found `fixup!`

"#]])
.stderr_eq(str![]);
}

#[test]
fn fixup_stops_checks() {
run_committed("fixup! bad times", "")
.code(1)
.stdout_eq(str![[r#"
-: error Fixup commits must be squashed

"#]])
.stderr_eq(str![]);
}

#[track_caller]
fn run_committed(message: &str, config: &str) -> snapbox::cmd::OutputAssert {
let root = snapbox::dir::DirRoot::mutable_temp().unwrap();