Example #1
0
		BeforeEach(func() {
			installation = NewInstallation(
				target,
				installedJob,
				installationManifest,
				mockRegistryServerManager,
			)
		})

		It("cleans up installed jobs", func() {
			err := installer.Cleanup(installation)
			Expect(err).ToNot(HaveOccurred())

			Expect(fakeExtractor.CleanupCallCount()).To(Equal(1))

			blobstoreID, extractedBlobPath := fakeExtractor.CleanupArgsForCall(0)
			Expect(blobstoreID).To(Equal(installedJob.BlobstoreID))
			Expect(extractedBlobPath).To(Equal(installedJob.Path))
		})

		It("returns errors when cleaning up installed jobs", func() {
			fakeExtractor.CleanupReturns(errors.New("nope"))

			err := installer.Cleanup(installation)
			Expect(err).To(HaveOccurred())
			Expect(err.Error()).To(ContainSubstring("nope"))
		})
	})
})