本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/apifakes.FakeDomainRepository.FindSharedByNameReturns方法的典型用法代码示例。如果您正苦于以下问题:Golang FakeDomainRepository.FindSharedByNameReturns方法的具体用法?Golang FakeDomainRepository.FindSharedByNameReturns怎么用?Golang FakeDomainRepository.FindSharedByNameReturns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cloudfoundry/cli/cf/api/apifakes.FakeDomainRepository
的用法示例。
在下文中一共展示了FakeDomainRepository.FindSharedByNameReturns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
Expect(findDomainErr).NotTo(HaveOccurred())
Expect(fakeDomainRepository.FindPrivateByNameCallCount()).To(Equal(2))
Expect(fakeDomainRepository.FindSharedByNameCallCount()).To(Equal(2))
Expect(fakeDomainRepository.FindSharedByNameArgsForCall(0)).To(Equal("my-hostname.my-domain.com"))
Expect(fakeDomainRepository.FindSharedByNameArgsForCall(1)).To(Equal("my-domain.com"))
Expect(hostname).To(Equal("my-hostname"))
Expect(domain).To(Equal(sharedDomain))
})
})
})
Context("when the route does not belong to any existing domains", func() {
BeforeEach(func() {
routeName = "non-existant-domain.com"
fakeDomainRepository.FindPrivateByNameReturns(models.DomainFields{}, domainNotFoundError)
fakeDomainRepository.FindSharedByNameReturns(models.DomainFields{}, domainNotFoundError)
})
It("returns an error", func() {
Expect(findDomainErr).To(HaveOccurred())
Expect(findDomainErr.Error()).To(Equal("The route non-existant-domain.com did not match any existing domains."))
})
})
})
Describe("FindPath", func() {
Context("when there is a path", func() {
It("returns the route without path and the path", func() {
routeName := "host.domain/long/path"
route, path := routeActor.FindPath(routeName)
Expect(route).To(Equal("host.domain"))