本文整理汇总了Golang中github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud.DeleteStemcellErr方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeCloud.DeleteStemcellErr方法的具体用法?Golang FakeCloud.DeleteStemcellErr怎么用?Golang FakeCloud.DeleteStemcellErr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/bosh-init/cloud/fakes.FakeCloud
的用法示例。
在下文中一共展示了FakeCloud.DeleteStemcellErr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Expect(err).ToNot(HaveOccurred())
})
It("clears current stemcell in the repo", func() {
err := cloudStemcell.Delete()
Expect(err).ToNot(HaveOccurred())
_, found, err := stemcellRepo.FindCurrent()
Expect(err).ToNot(HaveOccurred())
Expect(found).To(BeFalse())
})
})
Context("when deleting stemcell in the cloud fails", func() {
BeforeEach(func() {
fakeCloud.DeleteStemcellErr = errors.New("fake-delete-stemcell-error")
})
It("returns an error", func() {
err := cloudStemcell.Delete()
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("fake-delete-stemcell-error"))
})
})
Context("when deleting stemcell in the cloud fails with StemcellNotFoundError", func() {
var deleteErr = bicloud.NewCPIError("delete_stemcell", bicloud.CmdError{
Type: bicloud.StemcellNotFoundError,
Message: "fake-stemcell-not-found-message",
})