network, netstat, test: Use `BeEmpty` matcher
It is an implementation detail on how an empty list is represented.
In Go, an empty list may be presented as `nil` or as a list with no
items.
The suggested matcher is agnostic to how an empty list is represented.
@@ -271,7 +271,7 @@ var _ = Describe("netstat", func() {
setup.NetStat.UpdateStatus(setup.Vmi, setup.Domain)
- Expect(setup.Vmi.Status.Interfaces).To(Equal([]v1.VirtualMachineInstanceNetworkInterface{}), "the SR-IOV interface should not be reported in the status.")
+ Expect(setup.Vmi.Status.Interfaces).To(BeEmpty(), "the SR-IOV interface should not be reported in the status.")
})
// The reporting of the SR-IOV interface when no guest-agent exists is missing.
@@ -458,7 +458,7 @@ var _ = Describe("netstat", func() {
setup.NetStat.UpdateStatus(setup.Vmi, setup.Domain)
- Expect(setup.Vmi.Status.Interfaces).To(Equal([]v1.VirtualMachineInstanceNetworkInterface{}))
+ Expect(setup.Vmi.Status.Interfaces).To(BeEmpty())
})
})
})
