(t *testing.T)
| 351 | } |
| 352 | |
| 353 | func TestScopeEnum_Invalid(t *testing.T) { |
| 354 | r := &rule.ScopeEnumRule{} |
| 355 | if err := r.Apply(lint.RuleSetting{ |
| 356 | Argument: []interface{}{"auth", "core"}, |
| 357 | Flags: map[string]interface{}{"allow-empty": false}, |
| 358 | }); err != nil { |
| 359 | t.Fatal(err) |
| 360 | } |
| 361 | _, ok := r.Validate(&mockCommit{scope: "unknown"}) |
| 362 | if ok { |
| 363 | t.Error("scope 'unknown' should fail") |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | func TestScopeEnum_EmptyAllowed(t *testing.T) { |
| 368 | r := &rule.ScopeEnumRule{} |