--- Scope rules ---
(t *testing.T)
| 337 | // --- Scope rules --- |
| 338 | |
| 339 | func TestScopeEnum_Valid(t *testing.T) { |
| 340 | r := &rule.ScopeEnumRule{} |
| 341 | if err := r.Apply(lint.RuleSetting{ |
| 342 | Argument: []interface{}{"auth", "core", "api"}, |
| 343 | Flags: map[string]interface{}{"allow-empty": false}, |
| 344 | }); err != nil { |
| 345 | t.Fatal(err) |
| 346 | } |
| 347 | _, ok := r.Validate(&mockCommit{scope: "auth"}) |
| 348 | if !ok { |
| 349 | t.Error("scope 'auth' should pass") |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | func TestScopeEnum_Invalid(t *testing.T) { |
| 354 | r := &rule.ScopeEnumRule{} |