@@ -1545,7 +1545,7 @@ func Test_ListTags(t *testing.T) {
15451545 {
15461546 Name : github .Ptr ("v1.0.0" ),
15471547 Commit : & github.Commit {
1548- SHA : github .Ptr ("abc123 " ),
1548+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
15491549 URL : github .Ptr ("https://api.github.com/repos/owner/repo/commits/abc123" ),
15501550 },
15511551 ZipballURL : github .Ptr ("https://github.com/owner/repo/zipball/v1.0.0" ),
@@ -1554,7 +1554,7 @@ func Test_ListTags(t *testing.T) {
15541554 {
15551555 Name : github .Ptr ("v0.9.0" ),
15561556 Commit : & github.Commit {
1557- SHA : github .Ptr ("def456 " ),
1557+ SHA : github .Ptr ("v0.9.0-tag-sha " ),
15581558 URL : github .Ptr ("https://api.github.com/repos/owner/repo/commits/def456" ),
15591559 },
15601560 ZipballURL : github .Ptr ("https://github.com/owner/repo/zipball/v0.9.0" ),
@@ -1573,9 +1573,14 @@ func Test_ListTags(t *testing.T) {
15731573 {
15741574 name : "successful tags list" ,
15751575 mockedClient : mock .NewMockedHTTPClient (
1576- mock .WithRequestMatch (
1576+ mock .WithRequestMatchHandler (
15771577 mock .GetReposTagsByOwnerByRepo ,
1578- mockTags ,
1578+ expectPath (
1579+ t ,
1580+ "/repos/owner/repo/tags" ,
1581+ ).andThen (
1582+ mockResponse (t , http .StatusOK , mockTags ),
1583+ ),
15791584 ),
15801585 ),
15811586 requestArgs : map [string ]interface {}{
@@ -1659,12 +1664,12 @@ func Test_GetTag(t *testing.T) {
16591664 mockTagRef := & github.Reference {
16601665 Ref : github .Ptr ("refs/tags/v1.0.0" ),
16611666 Object : & github.GitObject {
1662- SHA : github .Ptr ("tag123 " ),
1667+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
16631668 },
16641669 }
16651670
16661671 mockTagObj := & github.Tag {
1667- SHA : github .Ptr ("tag123 " ),
1672+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
16681673 Tag : github .Ptr ("v1.0.0" ),
16691674 Message : github .Ptr ("Release v1.0.0" ),
16701675 Object : & github.GitObject {
@@ -1684,13 +1689,23 @@ func Test_GetTag(t *testing.T) {
16841689 {
16851690 name : "successful tag retrieval" ,
16861691 mockedClient : mock .NewMockedHTTPClient (
1687- mock .WithRequestMatch (
1692+ mock .WithRequestMatchHandler (
16881693 mock .GetReposGitRefByOwnerByRepoByRef ,
1689- mockTagRef ,
1694+ expectPath (
1695+ t ,
1696+ "/repos/owner/repo/git/ref/tags/v1.0.0" ,
1697+ ).andThen (
1698+ mockResponse (t , http .StatusOK , mockTagRef ),
1699+ ),
16901700 ),
1691- mock .WithRequestMatch (
1701+ mock .WithRequestMatchHandler (
16921702 mock .GetReposGitTagsByOwnerByRepoByTagSha ,
1693- mockTagObj ,
1703+ expectPath (
1704+ t ,
1705+ "/repos/owner/repo/git/tags/v1.0.0-tag-sha" ,
1706+ ).andThen (
1707+ mockResponse (t , http .StatusOK , mockTagObj ),
1708+ ),
16941709 ),
16951710 ),
16961711 requestArgs : map [string ]interface {}{
0 commit comments