@@ -1545,7 +1545,7 @@ func Test_ListTags(t *testing.T) {
1545
1545
{
1546
1546
Name : github .Ptr ("v1.0.0" ),
1547
1547
Commit : & github.Commit {
1548
- SHA : github .Ptr ("abc123 " ),
1548
+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
1549
1549
URL : github .Ptr ("https://api.github.com/repos/owner/repo/commits/abc123" ),
1550
1550
},
1551
1551
ZipballURL : github .Ptr ("https://github.com/owner/repo/zipball/v1.0.0" ),
@@ -1554,7 +1554,7 @@ func Test_ListTags(t *testing.T) {
1554
1554
{
1555
1555
Name : github .Ptr ("v0.9.0" ),
1556
1556
Commit : & github.Commit {
1557
- SHA : github .Ptr ("def456 " ),
1557
+ SHA : github .Ptr ("v0.9.0-tag-sha " ),
1558
1558
URL : github .Ptr ("https://api.github.com/repos/owner/repo/commits/def456" ),
1559
1559
},
1560
1560
ZipballURL : github .Ptr ("https://github.com/owner/repo/zipball/v0.9.0" ),
@@ -1573,9 +1573,14 @@ func Test_ListTags(t *testing.T) {
1573
1573
{
1574
1574
name : "successful tags list" ,
1575
1575
mockedClient : mock .NewMockedHTTPClient (
1576
- mock .WithRequestMatch (
1576
+ mock .WithRequestMatchHandler (
1577
1577
mock .GetReposTagsByOwnerByRepo ,
1578
- mockTags ,
1578
+ expectPath (
1579
+ t ,
1580
+ "/repos/owner/repo/tags" ,
1581
+ ).andThen (
1582
+ mockResponse (t , http .StatusOK , mockTags ),
1583
+ ),
1579
1584
),
1580
1585
),
1581
1586
requestArgs : map [string ]interface {}{
@@ -1659,12 +1664,12 @@ func Test_GetTag(t *testing.T) {
1659
1664
mockTagRef := & github.Reference {
1660
1665
Ref : github .Ptr ("refs/tags/v1.0.0" ),
1661
1666
Object : & github.GitObject {
1662
- SHA : github .Ptr ("tag123 " ),
1667
+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
1663
1668
},
1664
1669
}
1665
1670
1666
1671
mockTagObj := & github.Tag {
1667
- SHA : github .Ptr ("tag123 " ),
1672
+ SHA : github .Ptr ("v1.0.0-tag-sha " ),
1668
1673
Tag : github .Ptr ("v1.0.0" ),
1669
1674
Message : github .Ptr ("Release v1.0.0" ),
1670
1675
Object : & github.GitObject {
@@ -1684,13 +1689,23 @@ func Test_GetTag(t *testing.T) {
1684
1689
{
1685
1690
name : "successful tag retrieval" ,
1686
1691
mockedClient : mock .NewMockedHTTPClient (
1687
- mock .WithRequestMatch (
1692
+ mock .WithRequestMatchHandler (
1688
1693
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
+ ),
1690
1700
),
1691
- mock .WithRequestMatch (
1701
+ mock .WithRequestMatchHandler (
1692
1702
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
+ ),
1694
1709
),
1695
1710
),
1696
1711
requestArgs : map [string ]interface {}{
0 commit comments