diff options
author | Michael Muré <batolettre@gmail.com> | 2020-09-16 16:22:02 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-10-04 20:39:10 +0200 |
commit | ca720f165cb286d4372ad48595e532a2423f2f07 (patch) | |
tree | 6e1496a1a6603abbd473cc0060a5acebc763a68b /bug/operation_iterator_test.go | |
parent | d56ce3d5d9f5ef74201a8ee7c25be4820d435b47 (diff) | |
download | git-bug-ca720f165cb286d4372ad48595e532a2423f2f07.tar.gz |
cache,bug,identity: structural change
- bug doesn't commit identities anymore, only make sure they are commit
- cache use an IdentityResolver to load bugs with identities from the cache (deps injection)
- IdentityCache now are identity.Interface
Diffstat (limited to 'bug/operation_iterator_test.go')
-rw-r--r-- | bug/operation_iterator_test.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bug/operation_iterator_test.go b/bug/operation_iterator_test.go index fcc61d0f..5d245185 100644 --- a/bug/operation_iterator_test.go +++ b/bug/operation_iterator_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/repository" @@ -28,6 +28,9 @@ func TestOpIterator(t *testing.T) { mockRepo := repository.NewMockRepoForTest() rene := identity.NewIdentity("René Descartes", "rene@descartes.fr") + err := rene.Commit(mockRepo) + require.NoError(t, err) + unix := time.Now().Unix() createOp := NewCreateOp(rene, unix, "title", "message", nil) @@ -48,15 +51,15 @@ func TestOpIterator(t *testing.T) { bug1.Append(addCommentOp) bug1.Append(setStatusOp) bug1.Append(labelChangeOp) - err := bug1.Commit(mockRepo) - assert.NoError(t, err) + err = bug1.Commit(mockRepo) + require.NoError(t, err) // second pack bug1.Append(genTitleOp()) bug1.Append(genTitleOp()) bug1.Append(genTitleOp()) err = bug1.Commit(mockRepo) - assert.NoError(t, err) + require.NoError(t, err) // staging bug1.Append(genTitleOp()) @@ -71,5 +74,5 @@ func TestOpIterator(t *testing.T) { counter++ } - assert.Equal(t, 10, counter) + require.Equal(t, 10, counter) } |