{Name: "Creating disk"}, { Name: "Attaching disk 'fake-secondary-disk-cid' to VM 'fake-vm-cid'", Error: attachError, }, })) }) }) Context("when detaching the new disk fails", func() { var ( detachError = bosherr.Error("fake-detach-disk-error") ) BeforeEach(func() { fakeVM.SetDetachDiskBehavior(existingDisk, detachError) }) It("returns error", func() { _, err := diskDeployer.Deploy(diskPool, cloud, fakeVM, fakeStage) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("fake-detach-disk-error")) Expect(fakeStage.PerformCalls).To(Equal([]*fakebiui.PerformCall{ {Name: "Attaching disk 'fake-existing-disk-cid' to VM 'fake-vm-cid'"}, {Name: "Creating disk"}, {Name: "Attaching disk 'fake-secondary-disk-cid' to VM 'fake-vm-cid'"}, {Name: "Migrating disk content from 'fake-existing-disk-cid' to 'fake-secondary-disk-cid'"}, { Name: "Detaching disk 'fake-existing-disk-cid'", Error: detachError,