)) }) }) }) Describe("Validate", func() { It("returns error if max tries is < 1", func() { err := boshblob.NewRetryableBlobstore(innerBlobstore, -1, logger).Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Max tries must be > 0")) err = boshblob.NewRetryableBlobstore(innerBlobstore, 0, logger).Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("Max tries must be > 0")) }) It("delegates to inner blobstore to validate", func() { err := retryableBlobstore.Validate() Expect(err).ToNot(HaveOccurred()) }) It("returns error if inner blobstore validation fails", func() { innerBlobstore.ValidateError = bosherr.Error("fake-validate-error") err := retryableBlobstore.Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("fake-validate-error")) }) }) })