diff options
Diffstat (limited to 'bug/operation_test.go')
-rw-r--r-- | bug/operation_test.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bug/operation_test.go b/bug/operation_test.go index 2bf836f0..13373761 100644 --- a/bug/operation_test.go +++ b/bug/operation_test.go @@ -2,19 +2,12 @@ package bug import ( "testing" - "time" "github.com/MichaelMure/git-bug/util/git" + "github.com/stretchr/testify/require" ) func TestValidate(t *testing.T) { - rene := Person{ - Name: "René Descartes", - Email: "rene@descartes.fr", - } - - unix := time.Now().Unix() - good := []Operation{ NewCreateOp(rene, unix, "title", "message", nil), NewSetTitleOp(rene, unix, "title2", "title1"), @@ -68,3 +61,13 @@ func TestValidate(t *testing.T) { } } } + +func TestMetadata(t *testing.T) { + op := NewCreateOp(rene, unix, "title", "message", nil) + + op.SetMetadata("key", "value") + + val, ok := op.GetMetadata("key") + require.True(t, ok) + require.Equal(t, val, "value") +} |