============================================================ Signed-off-by and trailer-exists rules ============================================================
(t *testing.T)
| 1199 | // ============================================================ |
| 1200 | |
| 1201 | func TestSignedOffBy_Present_Pass(t *testing.T) { |
| 1202 | r := &rule.SignedOffByRule{} |
| 1203 | if err := r.Apply(lint.RuleSetting{Argument: "Signed-off-by:"}); err != nil { |
| 1204 | t.Fatal(err) |
| 1205 | } |
| 1206 | _, ok := r.Validate(&mockCommit{notes: []lint.Note{&mockNote{token: "Signed-off-by", value: "Jane Doe <jane@example.com>"}}}) |
| 1207 | if !ok { |
| 1208 | t.Error("message with Signed-off-by should pass") |
| 1209 | } |
| 1210 | } |
| 1211 | |
| 1212 | func TestSignedOffBy_NoColon_Present_Pass(t *testing.T) { |
| 1213 | r := &rule.SignedOffByRule{} |