本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/spacequotas/spacequotasfakes.FakeSpaceQuotaRepository.CreateReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeSpaceQuotaRepository.CreateReturns方法的具体用法?Golang FakeSpaceQuotaRepository.CreateReturns怎么用?Golang FakeSpaceQuotaRepository.CreateReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/cf/api/spacequotas/spacequotasfakes.FakeSpaceQuotaRepository
的用法示例。
在下文中一共展示了FakeSpaceQuotaRepository.CreateReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
flagContext.Parse("-m", "whoops", "wit mah hussle")
cmd.SetDependency(deps, false)
})
It("alerts the user when parsing the memory limit fails", func() {
Expect(runCLIErr).To(HaveOccurred())
runCLIErrStr := runCLIErr.Error()
Expect(runCLIErrStr).To(ContainSubstring("Invalid memory limit: whoops"))
Expect(runCLIErrStr).To(ContainSubstring("Byte quantity must be an integer with a unit of measurement like M, MB, G, or GB"))
})
})
Context("when the request fails", func() {
BeforeEach(func() {
flagContext.Parse("my-quota")
quotaRepo.CreateReturns(errors.New("WHOOP THERE IT IS"))
cmd.SetDependency(deps, false)
})
It("alets the user when creating the quota fails", func() {
Expect(runCLIErr).To(HaveOccurred())
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"Creating space quota", "my-quota", "my-org"},
))
Expect(runCLIErr.Error()).To(Equal("WHOOP THERE IT IS"))
})
})
Context("when the quota already exists", func() {
BeforeEach(func() {
flagContext.Parse("my-quota")