ContainerImage.Pinniped/internal/controllerlib/option_test.go
Andrew Keesler eab5c2b86b
Save 2 lines by using inline-style comments for Copyright
Signed-off-by: Andrew Keesler <akeesler@vmware.com>
2020-09-16 10:35:19 -04:00

26 lines
495 B
Go

// Copyright 2020 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package controllerlib
import (
"testing"
"k8s.io/client-go/tools/cache"
)
type getter bool
func (g *getter) Informer() cache.SharedIndexInformer {
*g = true
return nil
}
func TestInformerCalled(t *testing.T) {
g := getter(false)
_ = New(Config{}, WithInformer(&g, FilterByNames(nil), InformerOption{}))
if !g {
t.Error("expected InformerGetter.Informer() to be called")
}
}