Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
Signed-off-by: areller <[email protected]>
  • Loading branch information
areller committed Jun 7, 2022
1 parent f17423c commit d8d46fe
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions in_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,20 @@ var _ = Describe("In Command", func() {
}

buildAsset := func(id int64, name string) *github.ReleaseAsset {
state := "uploaded"
return &github.ReleaseAsset{
ID: github.Int64(id),
Name: &name,
ID: github.Int64(id),
Name: &name,
State: &state,
}
}

buildFailedAsset := func(id int64, name string) *github.ReleaseAsset {
state := "starter"
return &github.ReleaseAsset{
ID: github.Int64(id),
Name: &name,
State: &state,
}
}

Expand All @@ -99,6 +110,7 @@ var _ = Describe("In Command", func() {
buildAsset(0, "example.txt"),
buildAsset(1, "example.rtf"),
buildAsset(2, "example.wtf"),
buildFailedAsset(3, "example.doc"),
}, nil)

inRequest.Version = &resource.Version{
Expand Down Expand Up @@ -402,6 +414,7 @@ var _ = Describe("In Command", 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")))
Ω(githubClient.DownloadReleaseAssetCallCount()).Should(Equal(3))
})
})

Expand Down

0 comments on commit d8d46fe

Please sign in to comment.