| 1250 | } |
| 1251 | |
| 1252 | func TestTrailerExists_Present_Pass(t *testing.T) { |
| 1253 | r := &rule.TrailerExistsRule{} |
| 1254 | if err := r.Apply(lint.RuleSetting{Argument: "Co-authored-by:"}); err != nil { |
| 1255 | t.Fatal(err) |
| 1256 | } |
| 1257 | _, ok := r.Validate(&mockCommit{notes: []lint.Note{&mockNote{token: "Co-authored-by", value: "Bob <bob@example.com>"}}}) |
| 1258 | if !ok { |
| 1259 | t.Error("commit with Co-authored-by note should pass") |
| 1260 | } |
| 1261 | } |
| 1262 | |
| 1263 | func TestTrailerExists_Missing_Fail(t *testing.T) { |
| 1264 | r := &rule.TrailerExistsRule{} |