It's never pointers
This commit is contained in:
@@ -95,7 +95,8 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) {
|
||||
|
||||
fmt.Fprintf(c.writer, "downloading asset: %s\n", *asset.Name)
|
||||
|
||||
err := c.downloadFile(&asset, path)
|
||||
assetToDownload := asset
|
||||
err := c.downloadFile(&assetToDownload, path)
|
||||
if err != nil {
|
||||
return InResponse{}, err
|
||||
}
|
||||
|
@@ -108,7 +108,9 @@ var _ = Describe("In Command", func() {
|
||||
))
|
||||
})
|
||||
|
||||
PIt("downloads only the files that match the globs", func() {
|
||||
It("downloads only the files that match the globs", func() {
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(0)).Should(Equal(buildAsset(0, "example.txt")))
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(1)).Should(Equal(buildAsset(1, "example.rtf")))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -148,7 +150,10 @@ var _ = Describe("In Command", func() {
|
||||
))
|
||||
})
|
||||
|
||||
PIt("downloads all of the files", func() {
|
||||
It("downloads all of the files", func() {
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(0)).Should(Equal(buildAsset(0, "example.txt")))
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(1)).Should(Equal(buildAsset(1, "example.rtf")))
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(2)).Should(Equal(buildAsset(2, "example.wtf")))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -181,6 +186,10 @@ var _ = Describe("In Command", func() {
|
||||
BeforeEach(func() {
|
||||
githubClient.LatestReleaseReturns(buildRelease(1, "v0.37.0"), nil)
|
||||
|
||||
githubClient.ListReleaseAssetsReturns([]github.ReleaseAsset{
|
||||
buildAsset(0, "something.tgz"),
|
||||
}, nil)
|
||||
|
||||
inRequest.Version = nil
|
||||
inResponse, inErr = command.Run(destDir, inRequest)
|
||||
})
|
||||
@@ -222,7 +231,8 @@ var _ = Describe("In Command", func() {
|
||||
Ω(string(version)).Should(Equal("0.37.0"))
|
||||
})
|
||||
|
||||
PIt("fetches from the latest release", func() {
|
||||
It("fetches from the latest release", func() {
|
||||
Ω(*githubClient.DownloadReleaseAssetArgsForCall(0)).Should(Equal(buildAsset(0, "something.tgz")))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user