instances := repo.AvailableInstances() Expect(instances[0].Host).To(Equal("10.0.0.1")) Expect(instances[1].Host).To(Equal("10.0.0.2")) Expect(instances[2].Host).To(Equal("10.0.0.3")) }) }) Describe("#InstanceCount", func() { It("returns the total number of allocated nodes", func() { Expect(repo.InstanceCount()).To(Equal(0)) }) }) Describe("#Unbind", func() { It("returns an error", func() { err := repo.Unbind("NON-EXISTANT-INSTANCE", "SOME-BINDING") Expect(err).To(MatchError(brokerapi.ErrInstanceDoesNotExist)) }) }) }) Context("When one node is allocated", func() { BeforeEach(func() { err := repo.Create("foo") Expect(err).ToNot(HaveOccurred()) }) Describe("#Bind", func() { BeforeEach(func() { fakeAgentClient.CredentialsFunc = func(rootURL string) (redis.Credentials, error) { if rootURL == "https://10.0.0.1:1234" {