Add test cases for a helper function in controller manager
This commit is contained in:
@@ -60,6 +60,20 @@ func TestIsControllerEnabled(t *testing.T) {
|
|||||||
disabledByDefaultControllers: []string{"delta", "echo"},
|
disabledByDefaultControllers: []string{"delta", "echo"},
|
||||||
expected: false,
|
expected: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "on by star, not off by name",
|
||||||
|
controllerName: "alpha",
|
||||||
|
controllers: []string{"*", "-charlie"},
|
||||||
|
disabledByDefaultControllers: []string{"delta", "echo"},
|
||||||
|
expected: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "off by name with star",
|
||||||
|
controllerName: "charlie",
|
||||||
|
controllers: []string{"*", "-charlie"},
|
||||||
|
disabledByDefaultControllers: []string{"delta", "echo"},
|
||||||
|
expected: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "off by default implicit, no star",
|
name: "off by default implicit, no star",
|
||||||
controllerName: "foxtrot",
|
controllerName: "foxtrot",
|
||||||
|
Reference in New Issue
Block a user