本文整理汇总了Golang中github.com/pivotal-cf/cf-redis-broker/redis.LocalRepository.Setup方法的典型用法代码示例。如果您正苦于以下问题:Golang LocalRepository.Setup方法的具体用法?Golang LocalRepository.Setup怎么用?Golang LocalRepository.Setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pivotal-cf/cf-redis-broker/redis.LocalRepository
的用法示例。
在下文中一共展示了LocalRepository.Setup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
err = os.RemoveAll(tmpPidfileDir)
Expect(err).ToNot(HaveOccurred())
err = os.RemoveAll(tmpLogDir)
Expect(err).ToNot(HaveOccurred())
})
Context("When setup is successful", func() {
It("creates the appropriate directories", func() {
tmpInstanceDataDir := path.Join(tmpDataDir, instanceID)
tmpInstanceLogDir := path.Join(tmpLogDir, instanceID)
Expect(tmpInstanceDataDir).NotTo(BeADirectory())
Expect(tmpInstanceLogDir).NotTo(BeADirectory())
err := repo.Setup(&instance)
Expect(err).NotTo(HaveOccurred())
Expect(tmpInstanceDataDir).To(BeADirectory())
Expect(tmpInstanceLogDir).To(BeADirectory())
})
It("creates a lock file", func() {
err := repo.Setup(&instance)
Expect(err).NotTo(HaveOccurred())
lockFilePath := path.Join(tmpDataDir, instanceID, "lock")
Expect(lockFilePath).To(BeAnExistingFile())
})
It("writes the config file", func() {