diff --git a/pkg/cloudinit/controlplane_init_test.go b/pkg/cloudinit/controlplane_init_test.go index 781e69a2..33bc5d6b 100644 --- a/pkg/cloudinit/controlplane_init_test.go +++ b/pkg/cloudinit/controlplane_init_test.go @@ -68,7 +68,7 @@ func TestNewInitControlPlane(t *testing.T) { })) // NOTE (mateoflorido): Keep this test in sync with the expected paths in the controlplane_init.go file. - expectedPaths := []interface{}{ + g.Expect(config.WriteFiles).To(ConsistOf( HaveField("Path", "/capi/scripts/install.sh"), HaveField("Path", "/capi/scripts/bootstrap.sh"), HaveField("Path", "/capi/scripts/load-images.sh"), @@ -83,9 +83,7 @@ func TestNewInitControlPlane(t *testing.T) { HaveField("Path", "/capi/etc/snap-track"), HaveField("Path", "/capi/manifests/00-k8sd-proxy.yaml"), HaveField("Path", "/tmp/file"), - } - - g.Expect(config.WriteFiles).To(ConsistOf(expectedPaths...), "Some /capi/scripts files are missing") + ), "Some /capi/scripts files are missing") } func TestNewInitControlPlaneInvalidVersionError(t *testing.T) { diff --git a/pkg/cloudinit/controlplane_join_test.go b/pkg/cloudinit/controlplane_join_test.go index f109ad30..c3cc8663 100644 --- a/pkg/cloudinit/controlplane_join_test.go +++ b/pkg/cloudinit/controlplane_join_test.go @@ -49,7 +49,7 @@ func TestNewJoinControlPlane(t *testing.T) { })) // NOTE (mateoflorido): Keep this test in sync with the expected paths in the controlplane_join.go file. - expectedPaths := []interface{}{ + g.Expect(config.WriteFiles).To(ConsistOf( HaveField("Path", "/capi/scripts/install.sh"), HaveField("Path", "/capi/scripts/bootstrap.sh"), HaveField("Path", "/capi/scripts/load-images.sh"), @@ -63,9 +63,7 @@ func TestNewJoinControlPlane(t *testing.T) { HaveField("Path", "/capi/etc/join-token"), HaveField("Path", "/capi/etc/snap-track"), HaveField("Path", "/tmp/file"), - } - - g.Expect(config.WriteFiles).To(ConsistOf(expectedPaths...), "Some /capi/scripts files are missing") + ), "Some /capi/scripts files are missing") } func TestNewJoinControlPlaneInvalidVersionError(t *testing.T) { diff --git a/pkg/cloudinit/worker_join_test.go b/pkg/cloudinit/worker_join_test.go index 97615bec..20bc849b 100644 --- a/pkg/cloudinit/worker_join_test.go +++ b/pkg/cloudinit/worker_join_test.go @@ -49,7 +49,7 @@ func TestNewJoinWorker(t *testing.T) { })) // NOTE (mateoflorido): Keep this test in sync with the expected paths in the worker_join.go file. - expectedPaths := []interface{}{ + g.Expect(config.WriteFiles).To(ConsistOf( HaveField("Path", "/capi/scripts/install.sh"), HaveField("Path", "/capi/scripts/bootstrap.sh"), HaveField("Path", "/capi/scripts/load-images.sh"), @@ -63,9 +63,7 @@ func TestNewJoinWorker(t *testing.T) { HaveField("Path", "/capi/etc/join-token"), HaveField("Path", "/capi/etc/snap-track"), HaveField("Path", "/tmp/file"), - } - - g.Expect(config.WriteFiles).To(ConsistOf(expectedPaths...), "Some /capi/scripts files are missing") + ), "Some /capi/scripts files are missing") } func TestNewJoinWorkerInvalidVersionError(t *testing.T) {