(t *testing.T)
| 924 | } |
| 925 | |
| 926 | func TestDescriptionEmptyRule_NonEmptyPasses(t *testing.T) { |
| 927 | r := &rule.DescriptionEmptyRule{} |
| 928 | if err := r.Apply(lint.RuleSetting{}); err != nil { |
| 929 | t.Fatal(err) |
| 930 | } |
| 931 | _, ok := r.Validate(&mockCommit{description: "add new feature"}) |
| 932 | if !ok { |
| 933 | t.Error("non-empty description should pass description-empty rule") |
| 934 | } |
| 935 | } |
| 936 | |
| 937 | func TestDescriptionEmptyRule_EmptyFails(t *testing.T) { |
| 938 | r := &rule.DescriptionEmptyRule{} |