本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/spaces/spacesfakes.FakeSpaceRepository.SetAllowSSHCallCount方法的典型用法代碼示例。如果您正苦於以下問題:Golang FakeSpaceRepository.SetAllowSSHCallCount方法的具體用法?Golang FakeSpaceRepository.SetAllowSSHCallCount怎麽用?Golang FakeSpaceRepository.SetAllowSSHCallCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cloudfoundry/cli/cf/api/spaces/spacesfakes.FakeSpaceRepository
的用法示例。
在下文中一共展示了FakeSpaceRepository.SetAllowSSHCallCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
})
Context("Updating allow_ssh when not already set to true", func() {
Context("Update successfully", func() {
BeforeEach(func() {
space.AllowSSH = false
spaceReq := new(requirementsfakes.FakeSpaceRequirement)
spaceReq.GetSpaceReturns(space)
requirementsFactory.NewSpaceRequirementReturns(spaceReq)
})
It("updates the space's allow_ssh", func() {
runCommand("the-space-name")
Expect(spaceRepo.SetAllowSSHCallCount()).To(Equal(1))
spaceGUID, allow := spaceRepo.SetAllowSSHArgsForCall(0)
Expect(spaceGUID).To(Equal("the-space-guid"))
Expect(allow).To(Equal(true))
Expect(ui.Outputs()).To(ContainSubstrings([]string{"Enabling ssh support for space 'the-space-name'"}))
Expect(ui.Outputs()).To(ContainSubstrings([]string{"OK"}))
})
})
Context("Update fails", func() {
It("notifies user of any api error", func() {
spaceRepo.SetAllowSSHReturns(errors.New("api error"))
runCommand("the-space-name")
Expect(ui.Outputs()).To(ContainSubstrings(
[]string{"FAILED"},