Expect(err.Error()).To(ContainSubstring("fake-last-get-err")) Expect(innerBlobstore.GetBlobIDs).To(Equal( []string{"fake-blob-id", "fake-blob-id", "fake-blob-id"}, )) Expect(innerBlobstore.GetFingerprints).To(Equal( []string{"fake-fingerprint", "fake-fingerprint", "fake-fingerprint"}, )) }) }) }) Describe("CleanUp", func() { It("delegates to inner blobstore to clean up", func() { err := retryableBlobstore.CleanUp("/some/file") Expect(err).ToNot(HaveOccurred()) Expect(innerBlobstore.CleanUpFileName).To(Equal("/some/file")) }) It("returns error if inner blobstore cleaning up fails", func() { innerBlobstore.CleanUpErr = errors.New("fake-clean-up-error") err := retryableBlobstore.CleanUp("/some/file") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("fake-clean-up-error")) }) }) Describe("Delete", func() {
Expect(err.Error()).To(ContainSubstring("fake-get-error")) }) It("skips sha1 verification and returns without an error if sha1 is empty", func() { innerBlobstore.GetFileName = fixturePath fileName, err := sha1VerifiableBlobstore.Get("fake-blob-id", "") Expect(err).ToNot(HaveOccurred()) Expect(fileName).To(Equal(fixturePath)) }) }) Describe("CleanUp", func() { It("delegates to inner blobstore to clean up", func() { err := sha1VerifiableBlobstore.CleanUp("/some/file") Expect(err).ToNot(HaveOccurred()) Expect(innerBlobstore.CleanUpFileName).To(Equal("/some/file")) }) It("returns error if inner blobstore cleaning up fails", func() { innerBlobstore.CleanUpErr = errors.New("fake-clean-up-error") err := sha1VerifiableBlobstore.CleanUp("/some/file") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("fake-clean-up-error")) }) }) Describe("Delete", func() {