summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/tag_loader_test.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-02-20 18:19:02 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-02-20 19:01:08 +1100
commit39c56553b36eaa05d6a12bdb66fe612736f92344 (patch)
tree09de90701db29c7097846ff1418f4758886140af /pkg/commands/git_commands/tag_loader_test.go
parent9e2a3a87dd73b9a8979dd2ae5546303a94b5d75a (diff)
show tag message
Diffstat (limited to 'pkg/commands/git_commands/tag_loader_test.go')
-rw-r--r--pkg/commands/git_commands/tag_loader_test.go22
1 files changed, 8 insertions, 14 deletions
diff --git a/pkg/commands/git_commands/tag_loader_test.go b/pkg/commands/git_commands/tag_loader_test.go
index f8696cafa..61b55d018 100644
--- a/pkg/commands/git_commands/tag_loader_test.go
+++ b/pkg/commands/git_commands/tag_loader_test.go
@@ -9,12 +9,9 @@ import (
"github.com/stretchr/testify/assert"
)
-const tagsOutput = `v0.34
-v0.33
-v0.32.2
-v0.32.1
-v0.32
-testtag
+const tagsOutput = `tag1 this is my message
+tag2
+tag3 this is my other message
`
func TestGetTags(t *testing.T) {
@@ -29,21 +26,18 @@ func TestGetTags(t *testing.T) {
{
testName: "should return no tags if there are none",
runner: oscommands.NewFakeRunner(t).
- Expect(`git tag --list --sort=-creatordate`, "", nil),
+ Expect(`git tag --list -n --sort=-creatordate`, "", nil),
expectedTags: []*models.Tag{},
expectedError: nil,
},
{
testName: "should return tags if present",
runner: oscommands.NewFakeRunner(t).
- Expect(`git tag --list --sort=-creatordate`, tagsOutput, nil),
+ Expect(`git tag --list -n --sort=-creatordate`, tagsOutput, nil),
expectedTags: []*models.Tag{
- {Name: "v0.34"},
- {Name: "v0.33"},
- {Name: "v0.32.2"},
- {Name: "v0.32.1"},
- {Name: "v0.32"},
- {Name: "testtag"},
+ {Name: "tag1", Message: "this is my message"},
+ {Name: "tag2", Message: ""},
+ {Name: "tag3", Message: "this is my other message"},
},
expectedError: nil,
},