appFiles.AppFilesInDirReturns(allFiles, nil) appBitsRepo.GetApplicationFilesReturns(presentFiles, nil) }) AfterEach(func() { }) Context("when the input is a zipfile", func() { BeforeEach(func() { zipper.IsZipFileReturns(true) }) It("extracts the zip", func() { fileutils.TempDir("gather-files", func(tmpDir string, err error) { files, err := actor.GatherFiles(appDir, tmpDir) Expect(zipper.UnzipCallCount()).To(Equal(1)) Expect(err).NotTo(HaveOccurred()) Expect(files).To(Equal(presentFiles)) }) }) }) Context("when the input is a directory full of files", func() { BeforeEach(func() { zipper.IsZipFileReturns(false) }) It("does not try to unzip the directory", func() { fileutils.TempDir("gather-files", func(tmpDir string, err error) { files, err := actor.GatherFiles(appDir, tmpDir)