| 1121 | } |
| 1122 | |
| 1123 | func TestFooterLeadingBlank_WithoutBlank_Fail(t *testing.T) { |
| 1124 | r := &rule.FooterLeadingBlankRule{} |
| 1125 | if err := r.Apply(lint.RuleSetting{}); err != nil { |
| 1126 | t.Fatal(err) |
| 1127 | } |
| 1128 | msg := &mockCommit{ |
| 1129 | message: "feat: add feature\nbody text\nFixes: #123", |
| 1130 | footer: "Fixes: #123", |
| 1131 | } |
| 1132 | _, ok := r.Validate(msg) |
| 1133 | if ok { |
| 1134 | t.Error("footer without leading blank should fail") |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | func TestFooterLeadingBlank_EmptyFooter_Pass(t *testing.T) { |
| 1139 | r := &rule.FooterLeadingBlankRule{} |