diff options
author | Michael Muré <batolettre@gmail.com> | 2019-02-16 19:34:52 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-03-01 22:40:24 +0100 |
commit | da558b05ef79f4c80df10c6969a9ae5f4f764f96 (patch) | |
tree | 2d6bc5d2fb0a77ec6fdd3b7422e3aa760f118598 /commands/select | |
parent | d2483d83dd52365741f51eca106aa18c4e8d6420 (diff) | |
download | git-bug-da558b05ef79f4c80df10c6969a9ae5f4f764f96.tar.gz |
identity: all tests green o/
Diffstat (limited to 'commands/select')
-rw-r--r-- | commands/select/select_test.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/commands/select/select_test.go b/commands/select/select_test.go index 003dfc81..f26350f8 100644 --- a/commands/select/select_test.go +++ b/commands/select/select_test.go @@ -2,15 +2,16 @@ package _select import ( "testing" + "time" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/util/test" "github.com/stretchr/testify/require" ) func TestSelect(t *testing.T) { repo := test.CreateRepo(false) - defer test.CleanupRepo(repo) repoCache, err := cache.NewRepoCache(repo) require.NoError(t, err) @@ -26,15 +27,18 @@ func TestSelect(t *testing.T) { require.Error(t, err) // generate a bunch of bugs + + rene := identity.NewBare("René Descartes", "rene@descartes.fr") + for i := 0; i < 10; i++ { - _, err := repoCache.NewBug("title", "message") + _, err := repoCache.NewBugRaw(rene, time.Now().Unix(), "title", "message", nil, nil) require.NoError(t, err) } // and two more for testing - b1, err := repoCache.NewBug("title", "message") + b1, err := repoCache.NewBugRaw(rene, time.Now().Unix(), "title", "message", nil, nil) require.NoError(t, err) - b2, err := repoCache.NewBug("title", "message") + b2, err := repoCache.NewBugRaw(rene, time.Now().Unix(), "title", "message", nil, nil) require.NoError(t, err) err = Select(repoCache, b1.Id()) @@ -71,4 +75,6 @@ func TestSelect(t *testing.T) { // Resolve without a pattern should error again after clearing the selected bug _, _, err = ResolveBug(repoCache, []string{}) require.Error(t, err) + + require.NoError(t, test.CleanupRepo(repo)) } |