var _ = Describe("GetHardwareAddress", func() { var ( context *fakes.Context linkFactory *fakes.LinkFactory hwAddr net.HardwareAddr getHWAddress *commands.GetHardwareAddress ) BeforeEach(func() { var err error hwAddr, err = net.ParseMAC("FF:FF:FF:FF:FF:FF") Expect(err).NotTo(HaveOccurred()) linkFactory = &fakes.LinkFactory{} linkFactory.HardwareAddressReturns(hwAddr, nil) context = &fakes.Context{} context.LinkFactoryReturns(linkFactory) getHWAddress = &commands.GetHardwareAddress{ LinkName: "some-link-name", } }) It("gets the hardware address", func() { err := getHWAddress.Execute(context) Expect(err).NotTo(HaveOccurred()) Expect(linkFactory.HardwareAddressCallCount()).To(Equal(1)) Expect(linkFactory.HardwareAddressArgsForCall(0)).To(Equal("some-link-name"))