diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-06-24 09:52:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 09:52:58 -0400 |
commit | 00b9e1a6028388b332f14ff3e607f02d589b637b (patch) | |
tree | 7e9a89ce480f537c3bbe0fb942d1bc9a1c3f758f /commands/user_create_test.go | |
parent | b694052c46a69b47e58526068109db2fbcca92af (diff) | |
parent | fd248de1eb5591ea977fdfcedf75d26f53636a5e (diff) | |
download | git-bug-00b9e1a6028388b332f14ff3e607f02d589b637b.tar.gz git-bug-00b9e1a6028388b332f14ff3e607f02d589b637b.zip |
Merge pull request #817 from MichaelMure/refactor/guarantee-test-cleanup
refactor(809): guarantee test cleanup
Diffstat (limited to 'commands/user_create_test.go')
-rw-r--r-- | commands/user_create_test.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/commands/user_create_test.go b/commands/user_create_test.go index 223e7ec3f..08958344f 100644 --- a/commands/user_create_test.go +++ b/commands/user_create_test.go @@ -1,21 +1,25 @@ package commands import ( - "path/filepath" "strings" "testing" "github.com/stretchr/testify/require" ) +const ( + testUserName = "John Doe" + testUserEmail = "jdoe@example.com" +) + func newTestEnvAndUser(t *testing.T) (*testEnv, string) { t.Helper() testEnv := newTestEnv(t) opts := createUserOptions{ - name: "John Doe", - email: "jdoe@example.com", + name: testUserName, + email: testUserEmail, avatarURL: "", nonInteractive: true, } @@ -29,8 +33,6 @@ func newTestEnvAndUser(t *testing.T) (*testEnv, string) { } func TestUserCreateCommand(t *testing.T) { - testEnv, userID := newTestEnvAndUser(t) - - require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "refs", "identities", userID)) - require.FileExists(t, filepath.Join(testEnv.cwd, ".git", "git-bug", "identity-cache")) + _, userID := newTestEnvAndUser(t) + require.Regexp(t, "[0-9a-f]{64}", userID) } |