本文整理匯總了Golang中code/cloudfoundry/org/cli/cf/api/spacequotas/spacequotasfakes.FakeSpaceQuotaRepository.CreateReturns方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeSpaceQuotaRepository.CreateReturns方法的具體用法?Golang FakeSpaceQuotaRepository.CreateReturns怎麽用?Golang FakeSpaceQuotaRepository.CreateReturns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類code/cloudfoundry/org/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")