}) }) It("creates a 'url' file that contains the URL", func() { urlPath := filepath.Join(destDir, "url") Ω(urlPath).ShouldNot(ExistOnFilesystem()) _, err := command.Run(destDir, request) Ω(err).ShouldNot(HaveOccurred()) Ω(urlPath).Should(ExistOnFilesystem()) contents, err := ioutil.ReadFile(urlPath) Ω(err).ShouldNot(HaveOccurred()) Ω(string(contents)).Should(Equal("http://google.com")) bucketName, remotePath, private, versionID := s3client.URLArgsForCall(0) Ω(bucketName).Should(Equal("bucket-name")) Ω(remotePath).Should(Equal("files/a-file-3.53.tgz")) Ω(versionID).Should(BeEmpty()) Ω(private).Should(Equal(false)) }) Context("when configured with private URLs", func() { BeforeEach(func() { request.Source.Private = true }) It("creates a 'url' file that contains the private URL if told to do that", func() { urlPath := filepath.Join(destDir, "url") Ω(urlPath).ShouldNot(ExistOnFilesystem())