(t *testing.T)
| 880 | } |
| 881 | |
| 882 | func TestBodyEmptyRule_NonEmptyPasses(t *testing.T) { |
| 883 | r := &rule.BodyEmptyRule{} |
| 884 | if err := r.Apply(lint.RuleSetting{}); err != nil { |
| 885 | t.Fatal(err) |
| 886 | } |
| 887 | _, ok := r.Validate(&mockCommit{body: "some body"}) |
| 888 | if !ok { |
| 889 | t.Error("non-empty body should pass body-empty rule") |
| 890 | } |
| 891 | } |
| 892 | |
| 893 | func TestBodyEmptyRule_EmptyFails(t *testing.T) { |
| 894 | r := &rule.BodyEmptyRule{} |