(t *testing.T)
| 379 | } |
| 380 | |
| 381 | func TestScopeEnum_EmptyNotAllowed(t *testing.T) { |
| 382 | r := &rule.ScopeEnumRule{} |
| 383 | if err := r.Apply(lint.RuleSetting{ |
| 384 | Argument: []interface{}{"auth"}, |
| 385 | Flags: map[string]interface{}{"allow-empty": false}, |
| 386 | }); err != nil { |
| 387 | t.Fatal(err) |
| 388 | } |
| 389 | _, ok := r.Validate(&mockCommit{scope: ""}) |
| 390 | if ok { |
| 391 | t.Error("empty scope with allow-empty=false should fail") |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | func TestScopeMinLen_Pass(t *testing.T) { |
| 396 | r := &rule.ScopeMinLenRule{} |