Example #1
0
			Expect(record).To(Equal(bistatepkg.CompiledPackageRecord{
				BlobID:   "fake-blob-id",
				BlobSHA1: "fake-fingerprint",
			}))
		})

		It("cleans up the packages dir", func() {
			_, _, err := compiler.Compile(pkg)
			Expect(err).ToNot(HaveOccurred())

			Expect(fs.FileExists(packagesDir)).To(BeFalse())
		})

		Context("when dependency installation fails", func() {
			JustBeforeEach(func() {
				fakeExtractor.ExtractReturns(errors.New("fake-install-error"))
			})

			It("returns an error", func() {
				_, _, err := compiler.Compile(pkg)
				Expect(err).To(HaveOccurred())
				Expect(err.Error()).To(ContainSubstring("fake-install-error"))
			})
		})

		Context("when the packaging script does not exist", func() {
			JustBeforeEach(func() {
				err := fs.RemoveAll(path.Join(pkg.ExtractedPath, "packaging"))
				Expect(err).ToNot(HaveOccurred())
			})