From b60542f0d13ae9ffa1a53512f9ee3d39182a4d3c Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Wed, 16 Dec 2020 21:09:02 -0600 Subject: [PATCH] Clean this test up a trivial amount using `require.Implementsf()`. Signed-off-by: Matt Moyer --- internal/controller/controller_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/controller/controller_test.go b/internal/controller/controller_test.go index 0cf97e21c..bfb354953 100644 --- a/internal/controller/controller_test.go +++ b/internal/controller/controller_test.go @@ -20,10 +20,8 @@ func TestCacheMutationDetectorEnabled(t *testing.T) { c := cache.NewCacheMutationDetector("test pinniped") - type isRealCacheMutationDetector interface { + type realCacheMutationDetector interface { CompareObjects() // this is brittle, but this function name has never changed... } - - _, ok := c.(isRealCacheMutationDetector) - require.Truef(t, ok, "%T is not a real cache mutation detector", c) + require.Implementsf(t, (*realCacheMutationDetector)(nil), c, "%T is not a real cache mutation detector", c) }